summaryrefslogtreecommitdiff
path: root/packages/backend/src/misc
diff options
context:
space:
mode:
authorHazelnoot <acomputerdog@gmail.com>2025-02-03 15:03:42 -0500
committerHazelnoot <acomputerdog@gmail.com>2025-02-03 15:03:42 -0500
commit3391c2414b0fc89d897fc3ecf66ca1dffaf6dfe9 (patch)
treeb8da205ca3c959a77a0b9faffce982f20cd54bf8 /packages/backend/src/misc
parentcopy changes to ci.yml and cypress-devcontainer.yml (diff)
downloadsharkey-3391c2414b0fc89d897fc3ecf66ca1dffaf6dfe9.tar.gz
sharkey-3391c2414b0fc89d897fc3ecf66ca1dffaf6dfe9.tar.bz2
sharkey-3391c2414b0fc89d897fc3ecf66ca1dffaf6dfe9.zip
add IdentifiableError.isRetryable to ensure that Identifiable Errors can still terminate a batch process
Diffstat (limited to 'packages/backend/src/misc')
-rw-r--r--packages/backend/src/misc/identifiable-error.ts8
1 files changed, 7 insertions, 1 deletions
diff --git a/packages/backend/src/misc/identifiable-error.ts b/packages/backend/src/misc/identifiable-error.ts
index 13c41f1e3b..f5c3fcd6cb 100644
--- a/packages/backend/src/misc/identifiable-error.ts
+++ b/packages/backend/src/misc/identifiable-error.ts
@@ -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;
}
}