Skip to content

Commit

Permalink
refactor: Handle possible exception
Browse files Browse the repository at this point in the history
  • Loading branch information
oboukli committed Feb 8, 2024
1 parent e92a6a2 commit bb1e5d8
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions src/Aktabook.Bus/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -128,12 +128,17 @@
{
Log.Fatal(criticalErrorContext.Exception, "Critical error: {Error}", criticalErrorContext.Error);

Check warning on line 129 in src/Aktabook.Bus/Program.cs

View workflow job for this annotation

GitHub Actions / Quality gate

Replace this string literal with a string retrieved through an instance of the 'ResourceManager' class.
await criticalErrorContext.Stop(cancellationToken).ConfigureAwait(false);
await Log.CloseAndFlushAsync().ConfigureAwait(false);
string output = $"NServiceBus critical error:\n{criticalErrorContext.Error}\nShutting down.";
Environment.FailFast(output, criticalErrorContext.Exception);
try
{
await criticalErrorContext.Stop(cancellationToken).ConfigureAwait(false);
}
finally
{
await Log.CloseAndFlushAsync().ConfigureAwait(false);
string output = $"NServiceBus critical error:\n{criticalErrorContext.Error}\nShutting down.";

Check failure

Code scanning / InspectCode

Ambiguous invocation: void AppendFormatted(object?, int, string?) (in struct DefaultInterpolatedStringHandler) void AppendFormatted(string?, int, string?) (in struct DefaultInterpolatedStringHandler) void AppendFormatted(string?) (in struct DefaultInterpolatedStringHandler) void AppendFormatted(System.ReadOnlySpan, int, string?) (in struct DefaultInterpolatedStringHandler) void AppendFormatted(System.ReadOnlySpan) (in struct DefaultInterpolatedStringHandler) match Error

Ambiguous invocation:
void AppendFormatted(object?, int, string?) (in struct DefaultInterpolatedStringHandler)
void AppendFormatted(string?, int, string?) (in struct DefaultInterpolatedStringHandler)
void AppendFormatted(string?) (in struct DefaultInterpolatedStringHandler)
void AppendFormatted(System.ReadOnlySpan, int, string?) (in struct DefaultInterpolatedStringHandler)
void AppendFormatted(System.ReadOnlySpan) (in struct DefaultInterpolatedStringHandler)
match
Environment.FailFast(output, criticalErrorContext.Exception);
}
});
return endpointConfiguration;
Expand Down

0 comments on commit bb1e5d8

Please sign in to comment.