-
Notifications
You must be signed in to change notification settings - Fork 0
/
remote-activity-observable-exceptions.ts
57 lines (47 loc) · 1.81 KB
/
remote-activity-observable-exceptions.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
import { ActivityDecisionStateMachine } from '../../../context/state-machines/history-event-state-machines/activity-decision-state-machine/activity-decision';
import { ActivityTimeoutType } from '../../../../aws/workflow-history/activity-timeout-type';
export class ScheduleFailedException extends Error {
public cause: string;
constructor(public stateMachine: ActivityDecisionStateMachine) {
super(`Activity schedule failed: ${stateMachine.cause}`);
this.cause = stateMachine.cause;
}
}
export class FailedException extends Error {
public reason: string;
public details: string;
constructor(public stateMachine: ActivityDecisionStateMachine) {
super(`Activity failed: ${stateMachine.reason} - ${stateMachine.details}`);
this.reason = stateMachine.reason;
this.details = stateMachine.details;
}
}
export class TimeoutException extends Error {
public timeoutType: ActivityTimeoutType;
public details: string;
constructor(public stateMachine: ActivityDecisionStateMachine) {
super(`Activity timed out: ${stateMachine.timeoutType} - ${stateMachine.details}`);
this.timeoutType = stateMachine.timeoutType;
this.details = stateMachine.details;
}
}
export class StartToCloseTimeoutException extends TimeoutException {
}
export class ScheduleToStartTimeoutException extends TimeoutException {
}
export class ScheduleToCloseTimeoutException extends TimeoutException {
}
export class HeartbeatTimeoutException extends TimeoutException {
}
export class RequestCancelFailedException extends Error {
public cause: string;
constructor(private stateMachine: ActivityDecisionStateMachine) {
super(`Cancel request failed: ${stateMachine.cause}`);
this.cause = stateMachine.cause;
}
}
export class UnknownStateException extends Error {
constructor(message: string) {
super(message);
}
}