Skip to content

feat: keep the process alive on errors that escape a jsk eval - #22

Merged
otnc merged 1 commit into
mainfrom
fix/stop-error
Jul 4, 2026
Merged

feat: keep the process alive on errors that escape a jsk eval#22
otnc merged 1 commit into
mainfrom
fix/stop-error

Conversation

@otnc

@otnc otnc commented Jul 4, 2026

Copy link
Copy Markdown
Owner

jsk js/cjs/mjs/sh already catch and report errors within a command's own awaited chain, but an eval can also fail outside it (an unawaited promise that rejects later, an event listener it registered that throws) — Node's default for uncaughtException/unhandledRejection is to kill the process. Add catchProcessErrors (on by default) so djsk installs its own handlers that log instead of crashing, with an opt-out for bots that already handle these themselves.

Summary

  • Fix bug(s)
  • New feature(s)
  • Others

Why?

Related issue(s)

closes

Check

  • Check if duplicate PR(s) already exist.
  • Run pnpm check (lint, format & typecheck)
  • Run pnpm test (functions test)
  • Run pnpm build (dist/)

jsk js/cjs/mjs/sh already catch and report errors within a command's own
awaited chain, but an eval can also fail outside it (an unawaited promise
that rejects later, an event listener it registered that throws) — Node's
default for uncaughtException/unhandledRejection is to kill the process.
Add catchProcessErrors (on by default) so djsk installs its own handlers
that log instead of crashing, with an opt-out for bots that already handle
these themselves.
@otnc
otnc merged commit 0db32d8 into main Jul 4, 2026
5 checks passed
@otnc
otnc deleted the fix/stop-error branch July 4, 2026 12:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant