title: How to handle hapi validation errors?
body: <p>I have following route code for hapi...</p>
  
  <hr>
  
  <pre><code>const routeConfig = {
    method: 'POST',
    path: '/user',
    config: {
      validate: {
        payload: {
          firstName: Joi.string().required(),
        }
      },
      handler
    }
  }
  </code></pre>
  
  <p>So when I don't pass the <code>firstName</code> it throws error like this</p>
  
  <pre><code>{
      "statusCode": 400,
      "error": "Bad Request",
      "message": "child \"firstName\" fails because [\"firstName\" is required]",
      "validation": {
          "source": "payload",
          "keys": [
              "firstName"
          ]
      }
  }
  </code></pre>
  
  <p>Now, I need to handle the above error in catch</p>
  
  <pre><code>const handler = async(request, reply) =&gt; {
    try {
      const payload = request.payload
      const createUser = await User.create(payload)
      let token = Helpers.createJwt(createUser) 
      reply({ success: true, message: 'User created successFully', token })
    } catch(err) {
       // need to do something here to handle the error like
       if (err) {
         reply ({ error: "firstName is required", message: "Signup unsuccessfull" })
       }
    }
  }
  </code></pre>