Skip to content

Commit

Permalink
Report job exceptions as errors
Browse files Browse the repository at this point in the history
  • Loading branch information
MihaZupan committed May 18, 2024
1 parent 85c51fe commit 1c99394
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Runner/JobBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public async Task RunJobAsync()
catch (Exception ex)
{
Console.WriteLine($"Something went wrong: {ex}");
await LogAsync(ex.ToString());
await ErrorAsync(ex.ToString());
}

_completed = true;
Expand Down Expand Up @@ -143,9 +143,9 @@ private async Task ErrorAsync(string message)
{
try
{
_channel.Writer.TryComplete(new Exception(message));
await LogAsync($"ERROR: {message}");

await PostAsJsonAsync("Logs", new[] { $"ERROR: {message}" });
_channel.Writer.TryComplete(new Exception(message));
}
catch { }
}
Expand Down

0 comments on commit 1c99394

Please sign in to comment.