aboutsummaryrefslogtreecommitdiff
path: root/packages/taler-wallet-core/src/errors.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/taler-wallet-core/src/errors.ts')
-rw-r--r--packages/taler-wallet-core/src/errors.ts13
1 files changed, 13 insertions, 0 deletions
diff --git a/packages/taler-wallet-core/src/errors.ts b/packages/taler-wallet-core/src/errors.ts
index 62bde667d..0f4c480cd 100644
--- a/packages/taler-wallet-core/src/errors.ts
+++ b/packages/taler-wallet-core/src/errors.ts
@@ -113,6 +113,19 @@ function getDefaultHint(code: number): string {
}
}
+export class TalerProtocolViolationError<T = any> extends Error {
+ constructor(hint?: string) {
+ let msg: string;
+ if (hint) {
+ msg = `Taler protocol violation error (${hint})`;
+ } else {
+ msg = `Taler protocol violation error`;
+ }
+ super(msg);
+ Object.setPrototypeOf(this, TalerProtocolViolationError.prototype);
+ }
+}
+
export class TalerError<T = any> extends Error {
errorDetail: TalerErrorDetail & T;
private constructor(d: TalerErrorDetail & T) {