-
Notifications
You must be signed in to change notification settings - Fork 356
Exceptions Documentation and Testing #479
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
Conversation
LGTM probably have @yschimke look too |
Forgot some tests. 😄 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
super(message, cause); | ||
super( | ||
Objects.requireNonNull(message, "message must not be null"), | ||
Objects.requireNonNull(cause, "cause must not be null")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: this seems overly strict given that cause in RuntimeException is nullable. As it's in error handling code, being super strict here is likely to just translate some business errors into rarely seen NPE.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I’d wondered about this as I did it. Specifically, this was codifying existing intent. I’m happy to remove if you think that it the intent was inaccurate.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My concern wouldn't be with the ApplicationException created by users of the library ever passing in something like
new ApplicationException("failed reading from DB", e.getCause())
I'd weakly vote for removing, but wouldn't fight to the death over it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@yschimke I'd agree with you, and since I haven't seen any objections here I'll update.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
consider relaxing the NPE for cause == null, I understand the reasoning, but it means checking for nulls in more cases and only loses information at runtime.
This change adds Javadocs and tests to the exception hierarchy in rsocket- core. This change introduces the first JUnit 5 tests (and a fancy test interface!) as well as using AssertJ to make the assertions more fluent and understandable.
This change adds Javadocs and tests to the exception hierarchy in
rsocket-core
. This change introduces the first JUnit 5 tests (and a fancy test interface!) as well as using AssertJ to make the assertions more fluent and understandable.NOTE: There are a couple of API incompatibilities in this change, and if any of them are objectionable, I'm happy to revert them.
CancelException
was renamed toCanceledException
) to match the spec naming and to conform to the naming style of the other exceptions.NoAvailableRSocketException
,TimeoutException
andTransportException
were only used in thereactor-load-balancer
project. In an effort to keep them local to their usage, and to ensure thatreactor-core
stays as spec-focused as possible, these types were moved to thereactor-load-balancer
project.