shoc-frontend-new/src/domain/work-orders/errors/board-patch-errors.ts

24 lines
648 B
TypeScript
Raw Normal View History

import type { WorkOrderTableRow } from "@/domain/work-orders/types/work-order-table-row";
export class BoardPatchConflictError extends Error {
readonly status = 409;
readonly currentState: WorkOrderTableRow | null;
constructor(message: string, currentState: WorkOrderTableRow | null) {
super(message);
this.name = "BoardPatchConflictError";
this.currentState = currentState;
}
}
export class BoardPatchValidationError extends Error {
readonly status = 422;
readonly code: string;
constructor(code: string, message: string) {
super(message);
this.name = "BoardPatchValidationError";
this.code = code;
}
}