joi-http-errors
v0.0.1
Published
Joi error handler with http errors
Readme
joi-http-errors
Joi error handler with http errors
Usage
const Joi = require('joi')
const errorHandler = require('@local/joi-http-errors')
const schema = Joi.object({ email: Joi.string().email() })
schema
.validate({ email: '@exo' })
.catch(err => {
// err.status = 422
// err.source = { path, type, ... }
})
