add IdentifiableError.isRetryable to ensure that Identifiable Errors can still terminate a batch process

This commit is contained in:
Hazelnoot 2025-02-03 15:03:42 -05:00
parent 4a86ab6857
commit 3391c2414b
3 changed files with 16 additions and 2 deletions

View file

@ -10,9 +10,15 @@ export class IdentifiableError extends Error {
public message: string;
public id: string;
constructor(id: string, message?: string) {
/**
* Indicates that this is a temporary error that may be cleared by retrying
*/
public readonly isRetryable: boolean;
constructor(id: string, message?: string, isRetryable = false) {
super(message);
this.message = message ?? '';
this.id = id;
this.isRetryable = isRetryable;
}
}