GeezerVison is showing github.com — BaseServiceException should not extend RuntimeException · Issue #703 · googleapis/google-cloud-java
BaseServiceException should not extend RuntimeException #703DescriptionMaybe this ship has already sailed, but if it's still possible BaseServiceException should not extend RuntimeException. As is, I can't confidently make any calls to a gcloud-java method without wrapping them in a try-catch block, and should I accidentally miss one it could cause my whole application to crash. I would suggest it extend IOException instead, but just extending Exception would be great. Activitymziccard commented on Mar 2, 2016
I can't confidently make any calls to a gcloud-java method without wrapping them in a try-catch block
How would this be different if we extended IOException? You would still have to catch exceptions... mziccard commented on Mar 2, 2016 If this is about checked vs unchecked exceptions my (strong) preference is to stick to unchecked. As a reference also AWS uses unchecked exceptions: AmazonClientException extends RuntimeException and AmazonServiceException extends AmazonClientException. ajkannan commented on Mar 3, 2016 My preference is also to stay with unchecked exceptions. I do think we should make a pass through the library to make sure every method call that can throw an exception has the exception documented with an "@throws" in the javadoc. That way, people can avoid try/catch blocks for methods that don't return exceptions. aozarov commented on Mar 3, 2016 +1 for unchecked exceptions.
This was discussed early on by various people which all favored or agreed to it.
This is also the path that gRPC (grpc-java) is taking. dimo414 commented on Mar 3, 2016 Well if that's the consensus fair enough; personally it's a much more error-prone experience.
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|