(err: unknown)
| 59 | } |
| 60 | |
| 61 | export function exitCodeFor(err: unknown): number { |
| 62 | if (err instanceof CliApiError) { |
| 63 | if (err.httpStatus === 401 || err.code === 'AUTH_REQUIRED') return 2 |
| 64 | if (err.httpStatus === 403) return 3 |
| 65 | if (err.httpStatus === 404) return 4 |
| 66 | if (err.httpStatus === 429) return 5 |
| 67 | if (err.httpStatus >= 500) return 6 |
| 68 | } |
| 69 | if (err instanceof CliAuthError) return 2 |
| 70 | return 1 |
| 71 | } |
no outgoing calls
no test coverage detected