https://github.com/fritzy/drboom-seaquell
Extension for DrBoom to turn Seaquell errors into Boom (Hapi) errors.
https://github.com/fritzy/drboom-seaquell
Last synced: 6 months ago
JSON representation
Extension for DrBoom to turn Seaquell errors into Boom (Hapi) errors.
- Host: GitHub
- URL: https://github.com/fritzy/drboom-seaquell
- Owner: fritzy
- License: mit
- Created: 2015-12-10T19:50:07.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2015-12-31T19:07:31.000Z (almost 10 years ago)
- Last Synced: 2025-05-28T06:45:43.480Z (6 months ago)
- Language: JavaScript
- Size: 3.91 KB
- Stars: 0
- Watchers: 0
- 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 [SeaQuell](https://github.com/fritzy/seaquell) into Hapi HTTP Errors.
##Example / Boilerplate
Plugin registration boilerplate:
```javascript
var hapi = require('hapi');
var config = require('./config.json');
var Boom = require('boom');
var Seaquell = require('seaquell');
var server = new hapi.Server();
server.connection(config);
server.register([{
register: require('drboom'),
options: {
plugins: [require('drboom-seaquell')({Seaquell: Seaquell, Boom: Boom})]
},
}, function (err) {
server.log(['startup'], 'Loaded pgboom plugin');
server.start(function (err) {
//...
}
});
```
Now, you can pass your seaquell errors right on through to hapi reply!
```javascript
function someHandler(request, reply) {
SomeSeaquellModel.method(reply);
});
```