Skip to content

feat(errors): add SysModulesDisabledError typed error class#33

Merged
tercel merged 3 commits into
mainfrom
sys-modules-disabled-error
May 22, 2026
Merged

feat(errors): add SysModulesDisabledError typed error class#33
tercel merged 3 commits into
mainfrom
sys-modules-disabled-error

Conversation

@tercel
Copy link
Copy Markdown
Contributor

@tercel tercel commented May 22, 2026

Summary

Replaces bare throw new Error(...) raises in APCore.on / off / _requireSysModules with a typed SysModulesDisabledError (code SYS_MODULES_DISABLED, DEFAULT_RETRYABLE=false).

Callers can now dispatch on err instanceof SysModulesDisabledError or err.code === 'SYS_MODULES_DISABLED' instead of catching the generic Error base.

Cross-language equivalent of Rust's ErrorCode::SysModulesDisabled and the parallel apcore-python#29. Exported from both Node entry (src/index.ts) and browser entry (src/browser/index.ts).

Test plan

  • pnpm run build (tsc) → clean
  • pnpm test --run2721 passed / 0 failed / 2 skipped (117 files)
  • Both Node and browser entries export the new class
  • DEFAULT_RETRYABLE=false — sys_modules state is config-time, not retry-fixable

tercel added 3 commits May 22, 2026 11:04
Replaces bare `throw new Error(...)` raises in APCore.on / off /
_requireSysModules with a typed SysModulesDisabledError (code
SYS_MODULES_DISABLED, DEFAULT_RETRYABLE=false). Callers can now
dispatch on `err instanceof SysModulesDisabledError` or
`err.code === 'SYS_MODULES_DISABLED'` instead of catching the generic
Error base.

Cross-language equivalent of Rust's ErrorCode::SysModulesDisabled and
the parallel apcore-python#29 SysModulesDisabledError. Exported from
both the Node entry (`src/index.ts`) and browser entry
(`src/browser/index.ts`).

Test plan
- pnpm run build → tsc clean
- pnpm test --run → 2721 passed / 0 failed / 2 skipped (117 files)

Signed-off-by: tercel <tercel.yi@gmail.com>
Signed-off-by: tercel <tercel.yi@gmail.com>
@tercel tercel merged commit d383b0c into main May 22, 2026
1 of 2 checks passed
@tercel tercel deleted the sys-modules-disabled-error branch May 22, 2026 09:06
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