https://github.com/fritzy/drboom-tedious
Convert tedious errors into Hapi Boom errors.
https://github.com/fritzy/drboom-tedious
Last synced: 7 months ago
JSON representation
Convert tedious errors into Hapi Boom errors.
- Host: GitHub
- URL: https://github.com/fritzy/drboom-tedious
- Owner: fritzy
- License: mit
- Created: 2015-12-10T22:04:19.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2015-12-11T20:39:41.000Z (almost 10 years ago)
- Last Synced: 2025-01-25T21:55:24.940Z (9 months ago)
- Language: JavaScript
- Size: 3.91 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Dr. Boom: Seaquell

Auto-cast errors from [tedious](https://npmjs.org/package/tedious) into Hapi HTTP Errors.
##Example / Boilerplate
Plugin registration boilerplate:
```javascript
var hapi = require('hapi');
var config = require('./config.json');
var Boom = require('boom');
var server = new hapi.Server();
server.connection(config);
server.register([{
register: require('drboom'),
options: {
plugins: [require('drboom-tedious')()]
},
}, function (err) {
server.log(['startup'], 'Loaded pgboom plugin');
server.start(function (err) {
//...
}
});
```
Now, you can pass your tedious errors right on through to hapi reply!
```javascript
function someHandler(request, reply) {
mssql.query("some query", reply);
});
```