{"size": 387, "ext": "js", "max_stars_repo_path": "lib/NotSuccessfulResponseError.js", "max_stars_repo_name": "chinclubi/request-dynamic-wrapper", "max_stars_repo_stars_event_min_datetime": "2016-08-31T09:00:26.000Z", "max_stars_repo_stars_event_max_datetime": "2016-08-31T09:00:26.000Z", "max_issues_repo_path": "lib/NotSuccessfulResponseError.js", "max_issues_repo_name": "chinclubi/request-dynamic-wrapper", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "lib/NotSuccessfulResponseError.js", "max_forks_repo_name": "chinclubi/request-dynamic-wrapper", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 1, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 22.7647058824, "max_line_length": 48, "alphanum_fraction": 0.6899224806}
'use strict'
class NotSuccessfulResponseError extends Error {
  constructor(response) {
    super()
    if (response.body) {
      this.body = response.body
      this.message = response.body.message
    } else {
      this.message = 'unsuccessful response'
    }
    this.isOperational = true
    this.statusCode = response.statusCode
  }
}

module.exports = NotSuccessfulResponseError
