How to use @truffle/error - 1 common examples

To help you get started, we’ve selected a few @truffle/error examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github trufflesuite / truffle / packages / config / src / index.ts View on Github external
public static detect(options: any = {}, filename?: string): TruffleConfig {
    let configFile;
    const configPath = options.config;

    if (configPath) {
      configFile = path.isAbsolute(configPath)
        ? configPath
        : path.resolve(configPath);
    } else {
      configFile = TruffleConfig.search(options, filename);
    }

    if (!configFile) {
      throw new TruffleError("Could not find suitable configuration file.");
    }

    return TruffleConfig.load(configFile, options);
  }

@truffle/error

Simple module that allows native Error objects to be extended

MIT
Latest version published 8 months ago

Package Health Score

61 / 100
Full package analysis

Popular @truffle/error functions