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

Recover exceptions wrapped in same class correctly #17437

Merged

Conversation

sancar
Copy link
Contributor

@sancar sancar commented Aug 31, 2020

Follow up to #17212

We have added exceptions created by ExceptionUtil.tryWrapInSameClass
methods to the client.

ClientExceptionFactory.createException method was not handling these
exceptions correctly. More specifically, the cause was not set to the
exception if there was no Constructor with cause. This pr adds changes
to mitigate that.

related to #17433

Follow up to hazelcast#17212

We have added exceptions created by ExceptionUtil.tryWrapInSameClass
methods to the client.

ClientExceptionFactory.createException method was not handling these
exceptions correctly. More specifically, the cause was not set to the
exception if there was no Constructor with cause. This pr adds changes
to mitigate that.

related to hazelcast#17433
@sancar sancar added this to the 4.1 milestone Aug 31, 2020
@sancar sancar requested a review from a team as a code owner August 31, 2020 13:26
@sancar sancar self-assigned this Aug 31, 2020
@@ -329,7 +329,11 @@ private Throwable createException(Iterator<ErrorHolder> iterator) {
if (exceptionFactory == null) {
throwable = new UndefinedErrorCodeException(errorHolder.getMessage(), errorHolder.getClassName());
Copy link
Contributor

Choose a reason for hiding this comment

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

An off-topic proposal. This branch could be further improved to handle causes for unknown exceptions. See hazelcast/hazelcast-nodejs-client#576 (comment) for more details.

@sancar sancar merged commit d198967 into hazelcast:master Sep 1, 2020
@sancar sancar deleted the fix/recoverWrappedClassesCorrectly/master branch September 1, 2020 14:06
@mmedenjak mmedenjak added the Source: Internal PR or issue was opened by an employee label Sep 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Source: Internal PR or issue was opened by an employee Team: Client Type: Defect
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants