mirror of
https://github.com/whyour/qinglong.git
synced 2026-09-20 16:07:11 +08:00
feat(ql3): establish 3.0 incubation baseline
This commit is contained in:
@@ -0,0 +1,50 @@
|
||||
export class ExecutorError extends Error {
|
||||
constructor(
|
||||
message: string,
|
||||
public readonly code: string,
|
||||
public readonly cause?: unknown,
|
||||
) {
|
||||
super(message);
|
||||
this.name = new.target.name;
|
||||
}
|
||||
}
|
||||
|
||||
export class InvalidExecutionSpecError extends ExecutorError {
|
||||
constructor(message: string) {
|
||||
super(message, 'INVALID_EXECUTION_SPEC');
|
||||
}
|
||||
}
|
||||
|
||||
export class ExecutorCapabilityUnavailableError extends ExecutorError {
|
||||
constructor(public readonly capability: string) {
|
||||
super(
|
||||
`Required executor capability is unavailable: ${capability}`,
|
||||
'EXECUTOR_CAPABILITY_UNAVAILABLE',
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export class ExecutorStartError extends ExecutorError {
|
||||
constructor(cause?: unknown) {
|
||||
super(
|
||||
'Executor failed to start the process',
|
||||
'EXECUTOR_START_FAILED',
|
||||
cause,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export class ExecutorHandleNotFoundError extends ExecutorError {
|
||||
constructor(public readonly handleId: string) {
|
||||
super(
|
||||
'Execution handle is not owned by this executor instance',
|
||||
'EXECUTOR_HANDLE_NOT_FOUND',
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export class ExecutorStopError extends ExecutorError {
|
||||
constructor(cause?: unknown) {
|
||||
super('Executor failed to stop the process', 'EXECUTOR_STOP_FAILED', cause);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user