UNPKG

argosjs

Version:

Ethereum smart-contract events visualiser

28 lines (27 loc) 679 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); /** * Throw an error or just log to the console. * @todo: Some error can be ignored. Ignore it here * @param em */ function throwError(em) { var error = new Error(); error.name = em.type; error.message = em.reason + "\n"; if (em.dump) { console.log(em.dump); } switch (em.level) { case "log": console.log(error); break; case "warn": // console.log(error.name + ": " + error.message); throw error; case "error": default: throw error; } } exports.throwError = throwError;