mirror of
https://github.com/whyour/qinglong.git
synced 2026-09-23 03:18:09 +08:00
feat(ql3): establish 3.0 incubation baseline
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
export class CancellationDispatchError extends Error {
|
||||
constructor(
|
||||
message: string,
|
||||
public readonly code: string,
|
||||
public readonly retryable = false,
|
||||
public readonly cause?: unknown,
|
||||
) {
|
||||
super(message);
|
||||
this.name = new.target.name;
|
||||
}
|
||||
}
|
||||
|
||||
export class InvalidCancellationDispatchCommandError extends CancellationDispatchError {
|
||||
constructor(message: string) {
|
||||
super(message, 'INVALID_CANCELLATION_DISPATCH_COMMAND');
|
||||
}
|
||||
}
|
||||
|
||||
export class CancellationDispatchBindingConflictError extends CancellationDispatchError {
|
||||
constructor(runId: string, attemptId: string) {
|
||||
super(
|
||||
`Cancellation dispatch for Run ${runId} is already bound to another Attempt than ${attemptId}`,
|
||||
'CANCELLATION_DISPATCH_BINDING_CONFLICT',
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export class CancellationDispatchFenceRejectedError extends CancellationDispatchError {
|
||||
constructor(runId: string) {
|
||||
super(
|
||||
`Cancellation dispatch lease for Run ${runId} is stale or no longer owned by this worker`,
|
||||
'CANCELLATION_DISPATCH_FENCE_REJECTED',
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export class CancellationDispatchRepositoryError extends CancellationDispatchError {
|
||||
constructor(cause?: unknown) {
|
||||
super(
|
||||
'Cancellation dispatch repository operation failed',
|
||||
'CANCELLATION_DISPATCH_REPOSITORY_FAILED',
|
||||
false,
|
||||
cause,
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user