index.js
function HyperError(res) {
  Error.call(this);
  Error.captureStackTrace(this, arguments.callee);
  this.name = 'HyperError';
  this.status = res.status;
  if (res.body && res.body.error) this.message = res.body.error.message;
  else this.message = res.text;
}
function HyperError(res) {
  Error.call(this);
  Error.captureStackTrace(this, arguments.callee);
  this.name = 'HyperError';
  this.status = res.status;
  if (res.body && res.body.error) this.message = res.body.error.message;
  else this.message = res.text;
}
function HyperError ( res ) { Error . call ( this ) ; Error . captureStackTrace ( this , arguments . callee ) ; this . name = 'HyperError' ; this . status = res . status ; if ( res . body && res . body . error ) this . message = res . body . error . message ; else this . message = res . text ; }
Create a hyper error given a superagent response

@param {Response} res
Create a hyper error given a superagent response