Create a custom exception for duplicate keys
No description provided.
Comments (6)
-
-
reporter Well, it looks like there is no issue. It is already YAMLException. Please check the test 337: https://bitbucket.org/asomov/snakeyaml/src/190f378138123971777405fbabeab704724b1860/src/test/java/org/yaml/snakeyaml/issues/issue337/DuplicateKeyTest.java?at=default&fileviewer=file-view-default#DuplicateKeyTest.java-115
(ConstructorException extends YAMLException)
-
What I get if I try to parse the appropriate test resource is an IllegalStateException, thrown by https://bitbucket.org/asomov/snakeyaml/src/190f378138123971777405fbabeab704724b1860/src/main/java/org/yaml/snakeyaml/constructor/SafeConstructor.java?at=default&fileviewer=file-view-default#SafeConstructor.java-99
-
reporter Test is the best way to show the problem.
-
reporter - changed status to invalid
No feedback from the reporter.
-
reporter - changed status to duplicate
Duplicate of
#395. - Log in to comment
Hello, in my opinion throwing a YAMLException would already be better than throwing a more generic java.lang.IllegalStateException, as it happens now.