Skip to content

feat(observability): allow defining custom uncaught exception handler #10462

New issue

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

Merged
merged 3 commits into from
May 21, 2025

Conversation

char0n
Copy link
Member

@char0n char0n commented May 21, 2025

The goal of this change is to provide a plug point to allow
custom observability mechanisms to handle uncaught exceptions.

@char0n char0n requested review from glowcloud and Copilot May 21, 2025 12:07
@char0n char0n self-assigned this May 21, 2025
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds a plug point for a custom uncaught exception handler across the core system and exposes it in the React flavor.

  • Inject getSystem into all wrapWithTryCatch calls and reducers to retrieve the handler at runtime
  • Introduce uncaughtExceptionHandler in config defaults and type-cast mappings
  • Expose uncaughtExceptionHandler prop in swagger-ui-react and document it

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/core/system.js Pass getSystem into buildReducer, wrapWithTryCatch, etc.
src/core/config/type-cast/mappings.js Add mapping for uncaughtExceptionHandler
src/core/config/defaults.js Add default null for uncaughtExceptionHandler
flavors/swagger-ui-react/index.jsx Expose and pass through uncaughtExceptionHandler prop
flavors/swagger-ui-react/README.md Document new uncaughtExceptionHandler prop
Comments suppressed due to low confidence (1)

src/core/system.js:475

  • Consider adding unit tests for wrapWithTryCatch to verify that when a custom uncaughtExceptionHandler is provided it is called correctly and fallback to console.error otherwise.
function wrapWithTryCatch(fn, getSystem, {

@char0n char0n merged commit 0a438f2 into master May 21, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants