Class SchedulerErrorContext
- Namespace
- Quartz
- Assembly
- Quartz.dll
What went wrong, and — where the scheduler knew it — what it went wrong for.
public sealed record SchedulerErrorContext : IEquatable<SchedulerErrorContext>
- Inheritance
-
SchedulerErrorContext
- Implements
- Inherited Members
Remarks
SchedulerError(IScheduler, SchedulerErrorContext, CancellationToken) used to take a message and an exception, which said what happened but never which trigger or job it happened to. Most of the places that raise the event know: a job that threw is reported from its execution context, and a misfire notification that failed is reported from the trigger that misfired. Those facts arrive here rather than only inside the message text, so a listener can act on them instead of parsing prose.
The three keys are optional because some errors genuinely have no subject — a job store retrying a failed operation, or a scan for the next trigger to fire that never got as far as a trigger. A listener should treat a null as "the scheduler could not say", not as "this concerns no trigger".
Properties
Exception
The error itself.
public required SchedulerException Exception { get; init; }
Property Value
FireInstanceId
The firing the error concerns, matching FireInstanceId, or null when the error happened outside a firing.
public string? FireInstanceId { get; init; }
Property Value
JobKey
The job the error concerns, or null when the scheduler could not say.
public JobKey? JobKey { get; init; }
Property Value
Message
A description of what went wrong, written for a human reading a log.
public required string Message { get; init; }
Property Value
TriggerKey
The trigger the error concerns, or null when the scheduler could not say.
public TriggerKey? TriggerKey { get; init; }