import { ContractType } from "."; import { NonSpecificConstructionFilledUnserializable } from "../index"; interface _MallocError { mallocErrorMarker: "MALLOC ERROR MARKER"; type: MallocErrorTypes; message: string; errorCode?: number; raw?: any; } export interface MallocBuilderError extends _MallocError { type: MallocErrorTypes.MALLOC_BUILDER; } export interface MallocActionBuilderError extends _MallocError { type: MallocErrorTypes.MALLOC_ACTION_BUILDER; actionName: string; actionIndex: number; actionTypeUID: string; filledNonSpecificConstruction?: NonSpecificConstructionFilledUnserializable; } export interface MallocCompilerError extends _MallocError { type: MallocErrorTypes.MALLOC_COMPILER; } export interface MallocRunnerError extends _MallocError { type: MallocErrorTypes.MALLOC_RUNNER; code: number; contractType: ContractType; actionIdx?: number; actionName?: string; name?: string; } export type MallocError = | MallocActionBuilderError | MallocCompilerError | MallocRunnerError | MallocBuilderError; export enum MallocErrorTypes { // Corresponds to a an error building the general construction MALLOC_BUILDER = "Malloc Builder", // Corresponds to an error building a specific action in the construction MALLOC_ACTION_BUILDER = "Malloc Action Builder", // Corresponds to an error in compiling a built action MALLOC_COMPILER = "Malloc Compiler", // Corresponds to an error which occurred during runtime. MALLOC_RUNNER = "Malloc Runner", }