Skip to content

feature(core): exception handling#536

Merged
Citymonstret merged 9 commits into2.0.0-devfrom
feature/2.0.0/exception-handling
Dec 3, 2023
Merged

feature(core): exception handling#536
Citymonstret merged 9 commits into2.0.0-devfrom
feature/2.0.0/exception-handling

Conversation

@Citymonstret
Copy link
Copy Markdown
Member

@Citymonstret Citymonstret commented Dec 2, 2023

This introduces a new exception handling system that allows us to register exception handlers for both the precise exception types and their super types. This system also allows us to register multiple exception handlers for the same exception type.

We might want to add some utilities to make it easier to unwrap exceptions such as CommandExecutionException. This isn't strictly necessary as we have the ability to re-throw the wrapped type. However, it's probably not ideal for everyone to have to implement this on their own. This has (kind of) been resolved by adding ExceptionHandler.unwrappingHandler().

Before we make use of this API in the platform implementations I want to make sure that it's refined. Feedback is very welcome :)

This introduces a new exception handling system that allows us to register exception handlers for both the precise exception types _and_ their super types. This system also allows us to register multiple exception handlers for the same exception type.
@Citymonstret Citymonstret added help wanted Extra attention is needed 2.0.0 labels Dec 2, 2023
@Citymonstret Citymonstret added this to the 2.0.0 milestone Dec 2, 2023
@github-actions
Copy link
Copy Markdown

github-actions bot commented Dec 2, 2023

Test Results

  71 files  +1    71 suites  +1   14s ⏱️ -7s
456 tests +7  456 ✔️ +7  0 💤 ±0  0 ±0 
468 runs  +7  468 ✔️ +7  0 💤 ±0  0 ±0 

Results for commit e33a052. ± Comparison against base commit e15e706.

♻️ This comment has been updated with latest results.

@Citymonstret Citymonstret force-pushed the feature/2.0.0/exception-handling branch from b9cf73f to b0e6287 Compare December 2, 2023 11:32
Citymonstret pushed a commit that referenced this pull request Dec 2, 2023
builds on top of #536 to add annotated exception handler methods
@Citymonstret Citymonstret self-assigned this Dec 2, 2023
@Citymonstret Citymonstret merged commit 4169901 into 2.0.0-dev Dec 3, 2023
@Citymonstret Citymonstret deleted the feature/2.0.0/exception-handling branch December 3, 2023 07:39
@Citymonstret Citymonstret mentioned this pull request Dec 3, 2023
}

/**
* Returns an exception handler that throws the cause of the {@link ExceptionContext#exception()} if it's and instance
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

and instance

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

help wanted Extra attention is needed

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants