fix(coding): preserve runtime model and failure contracts
This commit is contained in:
14
electron/coding-runtime/runtime-errors.ts
Normal file
14
electron/coding-runtime/runtime-errors.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
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 };
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user