code: function throwStatusError(resp) {
    let err = new Error(resp.statusText || 'http error: ' + resp.status);
    err.type = resp.status;
    err.response = resp;
    err.url = resp.url;
    throw err;
  }
docs: Constructs and throws a response status error.