Skip to content

Commit

Permalink
Refined a try catch.
Browse files Browse the repository at this point in the history
  • Loading branch information
lextm committed Apr 6, 2023
1 parent d542d44 commit f135e9b
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion JexusManager.Features.Certificates/SelfCertificateDialog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,6 @@ public SelfCertificateDialog(IServiceProvider serviceProvider, CertificatesFeatu
start.WindowStyle = ProcessWindowStyle.Hidden;
process.Start();
process.WaitForExit();
File.Delete(p12File);
if (process.ExitCode == 0)
{
DialogResult = DialogResult.OK;
Expand All @@ -189,8 +188,18 @@ public SelfCertificateDialog(IServiceProvider serviceProvider, CertificatesFeatu
}
catch (Exception ex)
{
ShowError(ex, $"unexpected exception", false);
RollbarLocator.RollbarInstance.Error(ex);
}
finally
{
if (File.Exists(p12File))
{
File.Delete(p12File);
}
}
// TODO: flatten the two try catch.
}
catch (Exception ex)
{
Expand Down

0 comments on commit f135e9b

Please sign in to comment.