import type { Fr } from '@aztec/foundation/curves/bn254'; import type { RawAssertionPayload } from '@aztec/noir-acvm_js'; import type { BrilligFunctionId, DebugFileMap, DebugInfo, FunctionAbi, OpcodeLocation } from '@aztec/stdlib/abi'; import { type FailingFunction, type NoirCallStack, SimulationError, type SourceCodeLocation } from '@aztec/stdlib/errors'; /** * An error that occurred during the execution of a function. * @param message - the error message * @param failingFunction - the Aztec function that failed * @param noirCallStack - the internal call stack of the function that failed (within the failing Aztec function) * @param options - additional error options (an optional "cause" entry allows for a recursive error stack where * an error's cause may be an ExecutionError itself) */ export declare class ExecutionError extends Error { /** * The function that failed. */ failingFunction: FailingFunction; /** * The noir call stack of the function that failed. */ noirCallStack?: NoirCallStack | undefined; constructor(message: string, /** * The function that failed. */ failingFunction: FailingFunction, /** * The noir call stack of the function that failed. */ noirCallStack?: NoirCallStack | undefined, options?: ErrorOptions); } /** * Traverses the cause chain of an error. * @param error - The error to start from. * @param callback - A callback on every error, including the first one. */ export declare function traverseCauseChain(error: Error, callback: (error: Error) => void): void; /** * Creates a simulation error from an error chain generated during the execution of a function. * @param error - The error thrown during execution. * @returns - A simulation error. */ export declare function createSimulationError(error: Error, revertData?: Fr[]): SimulationError; /** * Resolves the source code locations from an array of opcode locations */ export declare function resolveOpcodeLocations(opcodeLocations: OpcodeLocation[], debug: DebugInfo, files: DebugFileMap, brilligFunctionId?: BrilligFunctionId): SourceCodeLocation[]; export declare function resolveAssertionMessage(errorPayload: RawAssertionPayload, abi: FunctionAbi): string | undefined; export declare function resolveAssertionMessageFromRevertData(revertData: Fr[], abi: FunctionAbi): string | undefined; export declare function resolveAssertionMessageFromError(err: Error, abi: FunctionAbi): string; //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZXJyb3JzLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvY29tbW9uL2Vycm9ycy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQ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