Package Exports
- better-errors
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (better-errors) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
better-errors
Better Nodejs error is a small nodejs package to render errors in a better way to make it easy for you to identify errors and fix it fast.
Installation
Install with npm:
$ npm install better-errors
Usage and Examples
- Unhandled Exception
Require better-errors
on your code and it will catch the unhandled errors and render it.
require('better-errors')
- Handled Exception
Import the BetterError
function and use it to render errors
const { BetterError } = require('better-errors');
//...
try{
functionCall()
}catch(error){
console.log(BetterError(error));
}
Show stacktrace
Stacktrace is hidden by default tro reduce confusion, if you want to show the stacktrace just add --show-stack
argument to node starting command.
$ node index.js --show-stack
Contributing
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
License
Distributed under the MIT License. See LICENSE
for more information.