(raw: unknown)
| 42 | // handles thrown HTTP errors applies to mid-stream failures too. |
| 43 | // Exported for unit tests. |
| 44 | export function toGatewayStreamError(raw: unknown): Error { |
| 45 | const err = raw as { message?: unknown; status?: unknown; code?: unknown } | null |
| 46 | const message = |
| 47 | typeof err?.message === "string" && err.message.length > 0 ? err.message : "Zoo Gateway stream error" |
| 48 | return Object.assign(new Error(message), { |
| 49 | status: typeof err?.status === "number" ? err.status : undefined, |
| 50 | code: typeof err?.code === "string" ? err.code : undefined, |
| 51 | }) |
| 52 | } |
| 53 | |
| 54 | function buildZooCodeSignInUrl(): string { |
| 55 | const callbackUri = encodeURIComponent( |
no outgoing calls
no test coverage detected