UNPKG

@nomiclabs/buidler

Version:

Buidler is an extensible developer tool that helps smart contract developers increase productivity by reliably bringing together the tools they want.

72 lines 2.93 kB
import { ErrorDescriptor } from "./errors-list"; declare const inspect: unique symbol; declare class CustomError extends Error { readonly parent?: Error | undefined; constructor(message: string, parent?: Error | undefined); [inspect](): string | undefined; } export declare class BuidlerError extends CustomError { static isBuidlerError(other: any): other is BuidlerError; readonly errorDescriptor: ErrorDescriptor; readonly number: number; private readonly _isBuidlerError; constructor(errorDescriptor: ErrorDescriptor, messageArguments?: { [p: string]: any; }, parentError?: Error); } /** * This class is used to throw errors from buidler plugins made by third parties. */ export declare class BuidlerPluginError extends CustomError { static isBuidlerPluginError(other: any): other is BuidlerPluginError; readonly pluginName: string; private readonly _isBuidlerPluginError; /** * Creates a BuidlerPluginError. * * @param pluginName The name of the plugin. * @param message An error message that will be shown to the user. * @param parent The error that causes this error to be thrown. */ constructor(pluginName: string, message: string, parent?: Error); /** * A DEPRECATED constructor that automatically obtains the caller package and * use it as plugin name. * * @deprecated Use the above constructor. * * @param message An error message that will be shown to the user. * @param parent The error that causes this error to be thrown. */ constructor(message: string, parent?: Error); } export declare class NomicLabsBuidlerPluginError extends BuidlerPluginError { shouldBeReported: boolean; static isNomicLabsBuidlerPluginError(other: any): other is NomicLabsBuidlerPluginError; private readonly _isNomicLabsBuidlerPluginError; /** * This class is used to throw errors from *core* buidler plugins. If you are * developing a third-party plugin, use BuidlerPluginError instead. */ constructor(pluginName: string, message: string, parent?: Error, shouldBeReported?: boolean); } /** * This function applies error messages templates like this: * * - Template is a string which contains a variable tags. A variable tag is a * a variable name surrounded by %. Eg: %plugin1% * - A variable name is a string of alphanumeric ascii characters. * - Every variable tag is replaced by its value. * - %% is replaced by %. * - Values can't contain variable tags. * - If a variable is not present in the template, but present in the values * object, an error is thrown. * * @param template The template string. * @param values A map of variable names to their values. */ export declare function applyErrorMessageTemplate(template: string, values: { [templateVar: string]: any; }): string; export {}; //# sourceMappingURL=errors.d.ts.map