-
Notifications
You must be signed in to change notification settings - Fork 33
Add AbstractServiceException and extend ServiceExceptionAssert to support EndpointServiceException
#1383
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
base: develop
Are you sure you want to change the base?
Conversation
Generate changelog in
|
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'm fairly sure this will not cause ABI breaks (we might want to add revapi if we don't already have it?), however reverting this change (if we end up reconsidering) would be one
| /** | ||
| * This class should not be used directly. The parent class for ServiceException and EndpointServiceException. | ||
| */ | ||
| public abstract class AbstractServiceError extends RuntimeException implements SafeLoggable { |
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: Could we name this AbstractServiceException since it's not an Error?
| public abstract class AbstractServiceError extends RuntimeException implements SafeLoggable { | |
| public abstract class AbstractServiceException extends RuntimeException implements SafeLoggable { |
| public abstract ErrorType getErrorType(); | ||
|
|
||
| protected AbstractServiceError(Throwable cause) { | ||
| super(cause); | ||
| } |
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.
Can we not share more implementation than this between the two existing exceptions? Or is the goal to share the minimum to start?
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 wanted to make it minimal given I'm making this public and don't want people to use this. We only need the error type to update the ServiceExceptionAssert.
[skip ci]
Invalidated by push of 83da95f
AbstractServiceError and extend ServiceExceptionAssert to support EndpointServiceExceptionAbstractServiceException and extend ServiceExceptionAssert to support EndpointServiceException
|
This PR has been automatically marked as stale because it has not been touched in the last 14 days. If you'd like to keep it open, please leave a comment or add the 'long-lived' label, otherwise it'll be closed in 7 days. |
Before this PR
When #1352 was added, the test utilities to assert properties on the
EndpointServiceExceptionwas not added.After this PR
This PR introduces a common abstract base class
AbstractServiceErrorwhich bothServiceExceptionandEndpointServiceExceptionextend. It also modifiesServiceExceptionAssertto useAbstractServiceErrorinstead ofServiceExceptionin the template variable.==COMMIT_MSG==
Add
AbstractServiceExceptionand extendServiceExceptionAssertto supportEndpointServiceException==COMMIT_MSG==
Possible downsides?
We are making
AbstractServiceErrorpublic so we can use it in theServiceExceptionAssertwhich lives in a different package. Ideally,AbstractServiceErrorwill not be public. A warning not to use the class was added to the docstring.