Skip to content

Commit 468fe84

Browse files
committed
feat(satp-hermes): retries and timeout of satp requests
Signed-off-by: sfilangio01 <[email protected]>
1 parent 4f5a02d commit 468fe84

File tree

6 files changed

+622
-230
lines changed

6 files changed

+622
-230
lines changed

:monitor:

16 KB
Binary file not shown.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { asError } from "@hyperledger/cactus-common";
2+
import { RuntimeError } from "run-time-error-cjs";
3+
4+
export class GatewayRetryOperationFailedError extends RuntimeError {
5+
constructor(
6+
public message: string,
7+
public cause: string | Error | null,
8+
) {
9+
super(message, asError(cause));
10+
this.name = this.constructor.name;
11+
Object.setPrototypeOf(this, new.target.prototype); // make sure prototype chain is set to error
12+
}
13+
}

packages/cactus-plugin-satp-hermes/src/main/typescript/core/errors/satp-errors.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,3 +101,18 @@ export class RecoverMessageError extends SATPInternalError {
101101
}
102102
// TODO client-facing error logic, maps SATPInternalErrors to user friendly errors
103103
export class SATPError extends Error {}
104+
105+
export class InvalidStageError extends SATPInternalError {
106+
constructor(
107+
fnTag: string,
108+
stage: string,
109+
sessionID: string,
110+
cause?: string | Error | null,
111+
) {
112+
super(
113+
`${fnTag}, Invalid stage: ${stage} for session: ${sessionID}`,
114+
cause ?? null,
115+
400,
116+
);
117+
}
118+
}

0 commit comments

Comments
 (0)