agco-adm/fortune — pull request #6 by kristofsajdak (2014-12-16 12:05:41+00:00)
Title: added support for JSON API errors

http://jsonapi.org/format/#errors

a JSONAPI_Error can now be thrown from a callback, fortune will render this back to the consumer in the correct format

e.g.

throw new JSONProblemError({
status: 400,
detail: 'Foo was baz'
});

a specialised Express error middleware will render any uncaught errors to JSONAPI Error output