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

Function handleError

packages/cli/src/commands/stats.ts:100–117  ·  view source on GitHub ↗
(error: unknown, options: StatsOptions)

Source from the content-addressed store, hash-verified

98}
99
100function handleError(error: unknown, options: StatsOptions): never {
101 const message = error instanceof Error ? error.message : String(error)
102 // User input errors should return InvalidUsage (2)
103 const exitCode =
104 error instanceof FileResolutionError ||
105 error instanceof ParseError ||
106 error instanceof NotFoundInProjectError ||
107 error instanceof InitNotebookResolutionError
108 ? ExitCode.InvalidUsage
109 : ExitCode.Error
110
111 if (options.output === 'json') {
112 outputJson({ success: false, error: message })
113 } else {
114 logError(message)
115 }
116 process.exit(exitCode)
117}

Callers 1

createStatsActionFunction · 0.70

Calls 1

outputJsonFunction · 0.90

Tested by

no test coverage detected