(
public readonly status: number,
message: string,
public readonly type: ApiErrorType = "server",
/** Retry-After seconds for rate limit errors */
public readonly retryAfterMs?: number
)
| 45 | |
| 46 | export class ApiError extends Error { |
| 47 | constructor( |
| 48 | public readonly status: number, |
| 49 | message: string, |
| 50 | public readonly type: ApiErrorType = "server", |
| 51 | /** Retry-After seconds for rate limit errors */ |
| 52 | public readonly retryAfterMs?: number |
| 53 | ) { |
| 54 | super(message); |
| 55 | this.name = "ApiError"; |
| 56 | } |
| 57 | |
| 58 | get isRetryable(): boolean { |
| 59 | return this.type === "network" || this.type === "server" || this.status >= 500; |
nothing calls this directly
no outgoing calls
no test coverage detected