0.0.1 • Published 6 years ago

joi-http-errors v0.0.1

Weekly downloads
5
License
-
Repository
-
Last release
6 years ago

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, ... }
  })