MCPcopy Index your code
hub / github.com/deepnote/deepnote / handleError

Function handleError

packages/cli/src/commands/analyze.ts:366–381  ·  view source on GitHub ↗
(error: unknown, options: AnalyzeOptions)

Source from the content-addressed store, hash-verified

364}
365
366function handleError(error: unknown, options: AnalyzeOptions): never {
367 const message = error instanceof Error ? error.message : String(error)
368 const exitCode =
369 error instanceof FileResolutionError || error instanceof ParseError || error instanceof InitNotebookResolutionError
370 ? ExitCode.InvalidUsage
371 : ExitCode.Error
372
373 if (options.output === 'json') {
374 outputJson({ success: false, error: message })
375 } else if (options.output === 'toon') {
376 outputToon({ success: false, error: message })
377 } else {
378 logError(message)
379 }
380 process.exit(exitCode)
381}

Callers 1

createAnalyzeActionFunction · 0.70

Calls 2

outputJsonFunction · 0.90
outputToonFunction · 0.90

Tested by

no test coverage detected