@authereum/zos
Version:
Command-line interface for the ZeppelinOS smart contract platform
25 lines • 916 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const zos_lib_1 = require("zos-lib");
const GENERIC_ERROR_MESSAGE = 'There was an undefined error. Please execute the same command again in verbose mode if necessary.';
class ErrorHandler {
constructor(error, { verbose }) {
this.error = error;
this.verbose = verbose;
}
call() {
if (!this.verbose) {
zos_lib_1.Loggy.stopAll();
const errorMessage = this.error.message || GENERIC_ERROR_MESSAGE;
zos_lib_1.Loggy.noSpin.error(__filename, 'call', 'error-message', errorMessage);
}
else {
zos_lib_1.Loggy.noSpin.error(__filename, 'call', 'error-message', this.error.stack);
}
if (this.error.cb)
this.error.cb();
process.exit(1);
}
}
exports.default = ErrorHandler;
//# sourceMappingURL=ErrorHandler.js.map