Click or drag to resize
IStateIgnoreJobLoadException Property
Gets whether transition to this state should ignore job de-serialization exceptions.

Namespace: Hangfire.States
Assembly: Hangfire.Core (in Hangfire.Core.dll) Version: 1.5.0.0
Syntax
bool IgnoreJobLoadException { get; }

Property Value

Type: Boolean
to move to the FailedState on deserialization exceptions, to ignore them.
Remarks

During a state transition, an instance of the Job class is deserialized to get state changing filters, and to allow state handlers to perform additional work related to the state.

However we cannot always deserialize a job, for example, when job method was removed from the code base or its assembly reference is missing. Since background processing is impossible anyway, the state machine moves such a background job to the FailedState in this case to highlight a problem to the developers (because deserialization exception may occur due to bad refactorings or other programming mistakes).

However, in some exceptional cases we can ignore deserialization exceptions, and allow a state transition for some states that does not require a Job instance. FailedState itself and DeletedState are examples of such a behavior.

Note Notes to Implementers
In general, implementers should return when implementing this property.
See Also