in packages/web-api-scan-request-sender/src/sender/on-demand-dispatcher.ts [114:153]
private async trace(scanRequest: ScanRequest): Promise<void> {
switch (scanRequest.condition) {
case 'notFound': {
this.logger.logError('The scan result document not found in a storage. Removing scan request from a request queue.', {
scanId: scanRequest.request.id,
});
break;
}
case 'completed': {
this.logger.logError('The scan request has been completed. Removing scan request from a request queue.', {
scanId: scanRequest.request.id,
});
break;
}
case 'noRetry': {
this.logger.logError('The scan request has reached maximum retry count. Removing scan request from a request queue.', {
scanId: scanRequest.request.id,
});
break;
}
case 'accepted': {
this.logger.logInfo('Sending scan request to a request queue.', {
scanId: scanRequest.request.id,
});
break;
}
case 'retry': {
this.logger.logInfo('Sending scan request to a request queue with new retry attempt.', {
scanId: scanRequest.request.id,
runState: scanRequest.result.run.state,
runTimestamp: scanRequest.result.run.timestamp,
runRetryCount: scanRequest.result.run.retryCount ? scanRequest.result.run.retryCount.toString() : '0',
});
break;
}
default: {
throw new Error(`The '${scanRequest.condition}' operation condition not supported.`);
}
}
}