Exceptions

Dealing with Exceptions — Hangfire Documentation
Bad things happen. Any method can throw different types of exceptions. These exceptions can be caused either by programming errors that require you to re-deploy the application, or transient errors, that can be fixed without additional deployment.
https://docs.hangfire.io/en/latest/background-processing/dealing-with-exceptions.html

By default when an exception is thrown, the task will be rescheduled, and there will be 10 retry attempts. You can change this with the following attribute.

[AutomaticRetry(Attempts = 0)]
public void BackgroundMethod()
{
}