joi-http-errors

0.0.1 • Public • Published

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

/joi-http-errors/

    Package Sidebar

    Install

    npm i joi-http-errors

    Weekly Downloads

    1

    Version

    0.0.1

    License

    none

    Last publish

    Collaborators

    • geraldhart100