(result: PromptResult<T>)
| 181 | * @throws {AbortError} When result.aborted is true. |
| 182 | */ |
| 183 | export function unwrapPromptResult<T>(result: PromptResult<T>): T { |
| 184 | if (result.aborted) { |
| 185 | throw new AbortError(result.reason) |
| 186 | } |
| 187 | return result.value |
| 188 | } |
| 189 | |
| 190 | /** |
| 191 | * Parses a JSON response body string from an API error to extract structured error details. |
no outgoing calls