Skip to content
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

Rethrow Phase4Exception for better error handling #48

Closed
wants to merge 1 commit into from
Closed

Rethrow Phase4Exception for better error handling #48

wants to merge 1 commit into from

Conversation

Florianisme
Copy link

I would like to propose a change to the way exceptions are handled when using the sendMessageAndCheckForReceipt method.
The older method sendMessage used to throw the exception back to the calling method where it then could be logged, persisted and handled accordingly.

While the newer method sendMessageAndCheckForReceipt also gives a general status back, it only prints the specific exception to the console which makes error handling a pain.

@phax phax self-assigned this Feb 12, 2021
@phax
Copy link
Owner

phax commented Feb 12, 2021

Thanks for your input. I will use a slightly different approach as throwing an Exception is not backwards compatible and it would remove one error code.
Instead I will add an overload with a Consumer<? super Phase4Exception> to collect it from the outside so that you can rethrow it from there.
Hope that also solves the issue

@Florianisme
Copy link
Author

Yes, that would definetly solve it, you can close the PR! Thanks!

phax added a commit that referenced this pull request Feb 12, 2021
@phax
Copy link
Owner

phax commented Feb 12, 2021

It's part of master now. Thanks for pointing it out

@phax phax closed this Feb 12, 2021
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.

None yet

2 participants