lib/parseError.js
function parseError(res, body) {
  // Res is optional.
  if (body == null) {
    body = res;
  }
  // Status code is required.
  const status = parseError.findErrorCode(sliced(arguments));
  if (!status) {
    return false;
  }
  // Body can have an error-like object, in which case the attributes will be used.
  const obj = findErrorObj(body);
  if (obj) {
    body = Object.assign(body, obj);
  }
  return [status, body];
}
function parseError(res, body) {
  // Res is optional.
  if (body == null) {
    body = res;
  }
  // Status code is required.
  const status = parseError.findErrorCode(sliced(arguments));
  if (!status) {
    return false;
  }
  // Body can have an error-like object, in which case the attributes will be used.
  const obj = findErrorObj(body);
  if (obj) {
    body = Object.assign(body, obj);
  }
  return [status, body];
}
function parseError ( res , body ) { // Res is optional. if ( body == null ) { body = res ; } // Status code is required. const status = parseError . findErrorCode ( sliced ( arguments ) ) ; if ( ! status ) { return false ; } // Body can have an error-like object, in which case the attributes will be used. const obj = findErrorObj ( body ) ; if ( obj ) { body = Object . assign ( body , obj ) ; } return [ status , body ] ; }
See if the response has a status error code, and if the error message has an error-like object.
See if the response has a status error code and if the error message has an error - like object .