For example, let's say commentjson is told to load the following:
{
// there is a trailing comma below
"c": 1,
}
This will be caught on commentjson.py:170 as a lark.exceptions.UnexpectedCharacters exception. That seems reasonable. Unfortunately, commentjson.py:205 will then catch this as a generic Exception and translate it into a JSONLibraryException(e). This is bad because it breaks API-compatibility with the Python json library, which would just raise a ValueError
For example, let's say commentjson is told to load the following:
This will be caught on
commentjson.py:170
as alark.exceptions.UnexpectedCharacters
exception. That seems reasonable. Unfortunately,commentjson.py:205
will then catch this as a genericException
and translate it into aJSONLibraryException(e)
. This is bad because it breaks API-compatibility with the Pythonjson
library, which would just raise aValueError