title: should missing fields in a POST request throw an error?
body: <p>I am writing a route for registering users. There are three required fields, name, email and password.</p>
  
  <p>How should I handle a missing field ?</p>
  
  <p>Like this ?</p>
  
  <pre><code>function(req, res) {
  
       if(!req.body.name || !req.body.email || !req.body.password) {
  
           res.status(400).json({
               "message": "All fields required"
           });
          return;
  
       }
  }
  </code></pre>
  
  <p>Or should I throw an error and pass it to my error handler like this :</p>
  
  <pre><code>function(req, res, next) {
  
       if(!req.body.name || !req.body.email || !req.body.password) {
  
            return next(new Error('All fields required'));
  
       }
  }
  </code></pre>