17 lines
408 B
TypeScript
17 lines
408 B
TypeScript
export class OrderStateTransitionError extends Error {
|
|
constructor(
|
|
public readonly from: string,
|
|
public readonly to: string,
|
|
) {
|
|
super(`Order state transition from ${from} to ${to} is not allowed`);
|
|
this.name = 'OrderStateTransitionError';
|
|
}
|
|
}
|
|
|
|
export class OrderNotFoundError extends Error {
|
|
constructor() {
|
|
super('Order not found');
|
|
this.name = 'OrderNotFoundError';
|
|
}
|
|
}
|