index.js
function getErrorStatusCode (err) {
  // check err.status
  if (typeof err.status === 'number' && err.status >= 400 && err.status < 600) {
    return err.status
  }

  // check err.statusCode
  if (typeof err.statusCode === 'number' && err.statusCode >= 400 && err.statusCode < 600) {
    return err.statusCode
  }

  return undefined
}
function getErrorStatusCode (err) {
  // check err.status
  if (typeof err.status === 'number' && err.status >= 400 && err.status < 600) {
    return err.status
  }

  // check err.statusCode
  if (typeof err.statusCode === 'number' && err.statusCode >= 400 && err.statusCode < 600) {
    return err.statusCode
  }

  return undefined
}
function getErrorStatusCode ( err ) { // check err.status if ( typeof err . status === 'number' && err . status >= 400 && err . status < 600 ) { return err . status } // check err.statusCode if ( typeof err . statusCode === 'number' && err . statusCode >= 400 && err . statusCode < 600 ) { return err . statusCode } return undefined }
Get status code from Error object.

@param {Error} err
@return {number}
@private
Get status code from Error object .