Skip to content

Commit d986b4e

Browse files
RGFuaWVsDaniel Steinmann
and
Daniel Steinmann
authored
Reformulate misleading error messages (#2446)
reformulate error messages Co-authored-by: Daniel Steinmann <[email protected]>
1 parent 78ad443 commit d986b4e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Diff for: src/Hangfire.Core/Processing/BackgroundExecution.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -475,21 +475,21 @@ private void ToFailedState(Exception exception, out TimeSpan retryDelay)
475475
// If threshold is zero, we'll go to the Failed state directly and log error anyway.
476476
if (_options.ErrorThreshold > TimeSpan.Zero)
477477
{
478-
_logger.DebugException($"{GetExecutionTemplate()} is in the Faulted state now due to an exception, execution will be retried no more than in {retryDelay}", exception);
478+
_logger.DebugException($"{GetExecutionTemplate()} is in the Faulted state now due to an exception, execution will be retried in no more than {retryDelay}", exception);
479479
}
480480
}
481481

482482
if (_failedSince == null && _faultedSince.Elapsed > _options.ErrorThreshold)
483483
{
484484
// Transition to Failed state, we should log the error message.
485-
_logger.ErrorException($"{GetExecutionTemplate()} is in the Failed state now due to an exception, execution will be retried no more than in {retryDelay}", exception);
485+
_logger.ErrorException($"{GetExecutionTemplate()} is in the Failed state now due to an exception, execution will be retried in no more than {retryDelay}", exception);
486486
_failedSince = Stopwatch.StartNew();
487487
}
488488
else if (_failedSince != null && _lastException.Elapsed >= _options.StillErrorThreshold)
489489
{
490490
// Still in the Failed state, we should log the error message as a reminder,
491491
// but shouldn't do this too often, especially for short retry intervals.
492-
_logger.ErrorException($"{GetExecutionTemplate()} is still in the Failed state for {_failedSince?.Elapsed} due to an exception, will be retried no more than in {retryDelay}", exception);
492+
_logger.ErrorException($"{GetExecutionTemplate()} is still in the Failed state for {_failedSince?.Elapsed} due to an exception, will be retried in no more than {retryDelay}", exception);
493493
}
494494
}
495495
}

0 commit comments

Comments
 (0)