import { AxiosError } from "axios";

export class UniteApiError extends Error {
  constructor(message: string,
    url?: string,
    requestHeaders?: any,
    request?: any,
    httpStatusCode?: number,
    response?: any) {
    super(message);

    this.name = "UniteApiError";

    this.url = url;
    this.requestHeaders = requestHeaders;
    this.request = request;
    this.response = response;
    this.httpStatusCode = httpStatusCode;

    Error.captureStackTrace(this, UniteApiError);
  }

  url: string;
  requestHeaders: { [key: string]: any };
  request: any;
  httpStatusCode: number;
  response?: any;
}