All files HttpError.js

0% Statements 0/4
100% Branches 0/0
0% Functions 0/1
0% Lines 0/4
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17                                 
/* eslint-disable prefer-class-properties/prefer-class-properties */
 
/**
 * Custom error to handle http errors
 * @extends Error
 */
export default class HttpError extends Error {
  constructor(response, url, method) {
    console.log(response);
    super(
      `Error when making a ${method} on ressource ${url}.\nSee response property of the error to access server logs.`
    );
    this.response = response;
    this.name = "HttpError";
  }
}