Add abstract BaseServiceException as ancestor of ServiceException and EndpointServiceException#1378
Add abstract BaseServiceException as ancestor of ServiceException and EndpointServiceException#1378
BaseServiceException as ancestor of ServiceException and EndpointServiceException#1378Conversation
Generate changelog in
|
mpritham
left a comment
There was a problem hiding this comment.
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.
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.
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?