An open API service indexing awesome lists of open source software.

https://github.com/bendrucker/hapi-bookshelf

Transform Bookshelf errors into proper Boom HTTP error responses
https://github.com/bendrucker/hapi-bookshelf

Last synced: over 1 year ago
JSON representation

Transform Bookshelf errors into proper Boom HTTP error responses

Awesome Lists containing this project

README

          

hapi-bookshelf [![Build Status](https://travis-ci.org/bendrucker/hapi-bookshelf.svg?branch=master)](https://travis-ci.org/bendrucker/hapi-bookshelf)
==============

Hapi plugin for transforming [Bookshelf](http://bookshelfjs.org)'s two "not found" errors into friendly [Boom](http://github.com/hapijs/boom) error responses.

Handles:
* [`Model.NotFound` errors](https://github.com/tgriesser/bookshelf/blob/master/lib/model.js#L100)
* [Updates that don't affect any rows](https://github.com/tgriesser/bookshelf/blob/master/lib/model.js#L223)