Method RecordFailedPreparationAsync
- Namespace
- MailFathom.Application.Jobs.Execution
- Assembly
- MailFathom.Application.dll
RecordFailedPreparationAsync(LeasedJob, Exception, CancellationToken)
Records an attempt whose handler could not be composed because what it reads failed to load first.
public Task<JobExecutionResult> RecordFailedPreparationAsync(LeasedJob job, Exception failure, CancellationToken stoppingToken)
Parameters
jobLeasedJobThe job this attempt holds.
failureExceptionWhat preparing the attempt raised.
stoppingTokenCancellationTokenReports that the host is stopping, in which case the job is released rather than failed.
Returns
- Task<JobExecutionResult>
What the attempt did, in terms that carry no mail content.
Remarks
The failure is classified and recorded exactly as a handler's own would be, so a database that was briefly away retries the job rather than failing the batch it was claimed in, and the exception is dropped once classified.
Exceptions
- ArgumentNullException
Thrown when
joborfailureis null.