ChisomUma commented on code in PR #10661:
URL: https://github.com/apache/gravitino/pull/10661#discussion_r3061802142
##########
api/src/main/java/org/apache/gravitino/tag/TagOperations.java:
##########
@@ -78,9 +78,10 @@ Tag createTag(String name, String comment, Map<String,
String> properties)
* @return The altered tag.
* @throws NoSuchTagException If the tag does not exist.
* @throws IllegalArgumentException If the changes cannot be applied to the
tag.
+ * @throws TagAlreadyExistsException If a tag with the new name already
exists.
*/
Tag alterTag(String name, TagChange... changes)
- throws NoSuchTagException, IllegalArgumentException;
+ throws NoSuchTagException, IllegalArgumentException,
TagAlreadyExistsException;
Review Comment:
I've reverted the changes to the API signatures, and instead Since
TagAlreadyExistsException is an unchecked exception that extends
RuntimeException, it should be possible to throw without being declared in the
method signature. So I added @ throws TagAlreadyExistsException to the JavaDoc
for TagOperations#alterTag and TagDispatcher#alterTag.
Given that the REST handlers and Client SDK already support the
reconstruction of TagAlreadyExistsException (mapping HTTP 409 back to the
specific exception type), Is this JavaDoc-only documentation of the unchecked
exception sufficient or do you have a more preferred pattern in mind?
@jerryshao
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]