The JsonParserStream throws IllegalStateException and IllegalArgumentException when incorrect data is provided. This requires the end-user to know this and additionally catch IllegalStateException and IllegalArgumentException if they want to provide more detail to help guide with fixing the error.
The
JsonParserStream
throwsIllegalStateException
andIllegalArgumentException
when incorrect data is provided. This requires the end-user to know this and additionally catchIllegalStateException
andIllegalArgumentException
if they want to provide more detail to help guide with fixing the error.For example:
https://github.com/opendaylight/yangtools/blob/v14.0.11/codec/yang-data-codec-gson/src/main/java/org/opendaylight/yangtools/yang/data/codec/gson/JsonParserStream.java
https://github.com/opendaylight/yangtools/blob/v14.0.11/codec/yang-data-codec-gson/src/main/java/org/opendaylight/yangtools/yang/data/codec/gson/JsonParserStream.java#L349C1-L350C70
Handle these exceptions in the parse method of
JsonParserStream
.