-
Couldn't load subscription status.
- Fork 33
Add abstract BaseServiceException as ancestor of ServiceException and EndpointServiceException
#1378
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.
After making EndpointServiceException abstract, I'd like to test out generating errors in conjure-java with this change to validate we haven't broken anything.
| * from a service endpoint. | ||
| */ | ||
| public abstract class EndpointServiceException extends RuntimeException implements SafeLoggable { | ||
| public final class EndpointServiceException extends BaseServiceException 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.
This should be abstract. EndpointServiceExceptions should not be initialized. They are extended by a specific endpoint associated error (e.g. here)
| import java.util.List; | ||
| import javax.annotation.Nullable; | ||
|
|
||
| public abstract class BaseServiceException extends RuntimeException { |
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 don't think this should be public. We don't expect any exceptions outside of ServiceException and EndpointServiceException to use this.
|
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
Struggled to write an assert in #1366 without duplicating a lot of code. Also, we had to create a
ServiceOrEndpointServiceExceptionin our repo so that we could handle bothServiceExceptions andEndpointServiceExceptions as the same thing, because they pretty much are.After
ServiceExceptionandEndpointServiceExceptionextendBaseServiceExceptionQuestions
I decided to make an abstract class vs. having
EndpointServiceExceptionextendServiceExceptionsinceServiceExceptionwas final. Thoughts on making it non-final?