13 lines
284 B
TypeScript
13 lines
284 B
TypeScript
export class ApiError extends Error {
|
|
status: number
|
|
retryAfter?: number
|
|
body?: string
|
|
|
|
constructor(status: number, retryAfter?: number, body?: string) {
|
|
super(`Request failed with status ${status}`)
|
|
this.status = status
|
|
this.retryAfter = retryAfter
|
|
this.body = body
|
|
}
|
|
}
|