https://github.com/chrisdothtml/better-fs-errors
Better-looking Node fs error outputs
https://github.com/chrisdothtml/better-fs-errors
Last synced: 2 months ago
JSON representation
Better-looking Node fs error outputs
- Host: GitHub
- URL: https://github.com/chrisdothtml/better-fs-errors
- Owner: chrisdothtml
- Created: 2015-09-07T17:59:22.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2015-09-07T21:21:40.000Z (almost 11 years ago)
- Last Synced: 2025-11-11T12:56:13.975Z (8 months ago)
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/better-fs-errors
- Size: 125 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
better-fs-errors
===
better-fs-errors is a node module that improves the way [fs](https://nodejs.org/api/fs.html) (file system) errors look. It uses the [errno](https://github.com/rvagg/node-errno) module to provide more helpful error messages based on the error code provided by node. This has not been fully tested with every possible error, so please report any issues you run into [here](https://github.com/chrisdothtml/better-fs-errors/issues).
Before:
````
Error: ENOENT, open 'path\to\problem\file'
at Error (native)
````
After:
````
------------------------------------------------
RAW ERROR:
Error: ENOENT, open 'path\to\problem\file'
ERROR DESCRIPTION:
no such file or directory
------------------------------------------------
````
Installation & Usage
===
Installing via npm
```
npm install better-fs-errors
```
Including the module
```js
var bfe = require('better-fs-errors');
```
Using
````js
throw bfe(err);
````
NOTE: If it can't find your error code in errno, it will return the original error.
# Dependencies
- [errno](https://github.com/rvagg/node-errno)