MCPcopy
hub / github.com/deepnote/deepnote / parseApiErrorMessage

Function parseApiErrorMessage

packages/cli/src/utils/deepnote-api.ts:21–31  ·  view source on GitHub ↗
(responseBody: string, fallback: string)

Source from the content-addressed store, hash-verified

19 * @returns The extracted error message
20 */
21export function parseApiErrorMessage(responseBody: string, fallback: string): string {
22 try {
23 const json = JSON.parse(responseBody)
24 if (json.error && typeof json.error === 'string') {
25 return json.error
26 }
27 } catch {
28 // Not JSON, use raw body
29 }
30 return responseBody || fallback
31}

Callers 2

initImportFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected