| 21 | |
| 22 | /** A GitHub REST API error response. */ |
| 23 | export class ApiError extends Error { |
| 24 | constructor(readonly status: number, method: string, path: string, message: string, readonly retryAfterMs?: number) { |
| 25 | super(`GitHub ${method} ${path}: HTTP ${status}: ${message}`); |
| 26 | } |
| 27 | } |
| 28 | |
| 29 | function transportCode(error: unknown): string | undefined { |
| 30 | for (const candidate of [error, error instanceof Error ? error.cause : undefined]) { |
nothing calls this directly
no outgoing calls
no test coverage detected