node-hue-api
Version:
Philips Hue API Library for Node.js
21 lines (14 loc) • 508 B
text/typescript
export default class HttpError extends Error {
public readonly status: number;
public readonly url: string;
public readonly headers?: { [k: string]: string[] };
public readonly data?: string;
constructor(status: number, url: string, headers?: { [k: string]: string[] }, data?: any) {
super();
this.status = status;
this.url = url;
this.headers = headers;
this.data = data;
this.message = `HTTP error status: ${status}${data ? '; ' + JSON.stringify(data) : ''}`;
}
}