(text: string)
| 68 | const decodeSdkHttpErrorText = Schema.decodeUnknownOption(SdkHttpErrorText); |
| 69 | |
| 70 | const parseJsonSafe = (text: string): unknown => { |
| 71 | // oxlint-disable-next-line executor/no-try-catch-or-throw -- boundary: classifying an untrusted upstream error body; a parse failure just means "not a JSON body" |
| 72 | try { |
| 73 | // oxlint-disable-next-line executor/no-json-parse -- boundary: the parsed value is only structurally decoded for a message field, never used as domain data |
| 74 | return JSON.parse(text) as unknown; |
| 75 | } catch { |
| 76 | return undefined; |
| 77 | } |
| 78 | }; |
| 79 | |
| 80 | /** The caller-facing message from a JSON error body the SDK's HTTP error |
| 81 | * carries, or `undefined` when there is none. */ |
no outgoing calls
no test coverage detected