0.0.1 • Published 6 years ago
joi-http-errors v0.0.1
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, ... }
})
0.0.1
6 years ago