error(req, res, errors, status = 400) {
    if (!Array.isArray(errors))
      errors = errors === undefined ? ['Unspecified error.'] : [errors];
    res.type('json');
    res.status(status);
    res.send({
      message: 'Could not perform action.',
      errors
    });
  }
// Error status is 400 (bad request) if not specified
Error status is 400 (bad request) if not specified
Error status is 400 ( bad request ) if not specified
error(req, res, errors, status = 400) {
    if (!Array.isArray(errors))
      errors = errors === undefined ? ['Unspecified error.'] : [errors];
    res.type('json');
    res.status(status);
    res.send({
      message: 'Could not perform action.',
      errors
    });
  }
error ( req , res , errors , status = 400 ) { if ( ! Array . isArray ( errors ) ) errors = errors === undefined ? [ 'Unspecified error.' ] : [ errors ] ; res . type ( 'json' ) ; res . status ( status ) ; res . send ( { message : 'Could not perform action.' , errors } ) ; }
Error status is 400 (bad request) if not specified
Error status is 400 ( bad request ) if not specified