We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SubprocessError
How about make the SubprocessError as an error instance instead of a type?
Currently it's a bit anonying when writing the error handling code in TypeScript:
try { await spawn(/* ... */); } catch (error} { if (error instanceof Error && (error as SubprocessError).signalName === "SIGKILL") { // ... } }
The code can be cleaner if we make the SubprocessError as an error instnace:
try { await spawn(/* ... */); } catch (error} { if (error instanceof SubprocessError && error.signalName === "SIGKILL") { // ... } }
Please correct me if there is a better way to write the code.
The text was updated successfully, but these errors were encountered:
Hi @LitoMore,
Thanks for the suggestion. It makes sense. 👍
Sorry, something went wrong.
Released with 0.2.0.
0.2.0
Successfully merging a pull request may close this issue.
How about make the
SubprocessError
as an error instance instead of a type?Currently it's a bit anonying when writing the error handling code in TypeScript:
The code can be cleaner if we make the
SubprocessError
as an error instnace:Please correct me if there is a better way to write the code.
The text was updated successfully, but these errors were encountered: