0.3.0 • Published 3 years ago

@open-node/errors v0.3.0

Weekly downloads
10
License
MIT
Repository
github
Last release
3 years ago

@open-node/errors

make the error object with custom defines

Build status codecov

Installation

Usage

  • your node.js process code

const defines = [ 'yourErrorCode', 'Your error message, allow add variable, eg: %s' ]; const errors = Errors(defines);

// usage in your code try { ... ... } catch (e) { const error = errors.yourErrorCode(e.message); // returns error be instanceOf Error writeErrorLog(error); }