/**
 * A status error is used to indicate responses with non-200 status codes
 */
 export class StatusError<T = any> extends Error
 {
	 /**
	  * The resulting body of a response
	  */
	 public readonly response: T;

	 /**
	  * The resulting status code of a response
	  */
	 public readonly statusCode?: number;

	 /**
	  * Create a new error indicating non-200 status
	  */
	 public constructor(response: T, statusCode: number) {
		 super();
		 Object.setPrototypeOf(this, StatusError.prototype);
		 this.response = response;
		 this.statusCode = statusCode;
	 }
 }
