Files
makelore/electron/coding-runtime/runtime-errors.ts

15 lines
410 B
TypeScript

import type {
CodingRuntimeErrorCode,
CodingRuntimePublicError,
} from './contracts';
export class CodingRuntimeContractError extends Error {
readonly publicError: CodingRuntimePublicError;
constructor(code: CodingRuntimeErrorCode, message: string, recoverable: boolean) {
super(message);
this.name = 'CodingRuntimeContractError';
this.publicError = { code, message, recoverable };
}
}