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,33 @@
|
||||
import type { RunAttemptStatus } from '../domain/run';
|
||||
|
||||
export class RunCommandError extends Error {
|
||||
constructor(message: string, public readonly code: string) {
|
||||
super(message);
|
||||
this.name = new.target.name;
|
||||
}
|
||||
}
|
||||
|
||||
export class RunNotFoundError extends RunCommandError {
|
||||
constructor(public readonly runId: string) {
|
||||
super('Run does not exist', 'RUN_NOT_FOUND');
|
||||
}
|
||||
}
|
||||
|
||||
export class RunAttemptNotFoundError extends RunCommandError {
|
||||
constructor(public readonly attemptId: string) {
|
||||
super('RunAttempt does not exist', 'RUN_ATTEMPT_NOT_FOUND');
|
||||
}
|
||||
}
|
||||
|
||||
export class RunAttemptConcurrentWriteError extends RunCommandError {
|
||||
constructor(
|
||||
public readonly attemptId: string,
|
||||
public readonly expectedStatus: RunAttemptStatus,
|
||||
public readonly expectedCallbackSequence: number,
|
||||
) {
|
||||
super(
|
||||
'RunAttempt changed while applying the command',
|
||||
'RUN_ATTEMPT_CONCURRENT_WRITE',
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user