You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to abort a CLI handler by throwing something, but control the exit code, and not see a stack trace.
I can think of two ways this might work:
a) ability to throw new CliError('message to log', exitCode)
b) optional errorHandler callback receives a thrown error and decides how to handle it. For example, any errors from an underlying http client can be logged in a specific format and exit with a specific exit code
I tried to use Exit for this, but it's not exported, and comments say it's an internal implementation detail of cmd-ts.
I'm using runSafely, but I had to copy the implementation of run into my code, and it's undocumented. Could this be as simple as explaining runSafely in the README?
The text was updated successfully, but these errors were encountered:
I would like to abort a CLI handler by
throw
ing something, but control the exit code, and not see a stack trace.I can think of two ways this might work:
a) ability to
throw new CliError('message to log', exitCode)
b) optional
errorHandler
callback receives a thrown error and decides how to handle it. For example, any errors from an underlying http client can be logged in a specific format and exit with a specific exit codeI tried to use
Exit
for this, but it's not exported, and comments say it's an internal implementation detail of cmd-ts.cmd-ts/src/effects.ts
Line 27 in 0d29e91
I'm using
runSafely
, but I had to copy the implementation ofrun
into my code, and it's undocumented. Could this be as simple as explainingrunSafely
in the README?The text was updated successfully, but these errors were encountered: