The current code raises SyntaxError on syntax errors. The problem with that is it’s impossible to catch EDN syntax errors and not other syntax errors. Also, SyntaxError is raised by the Python parser on bad code.
This PR adds a new exceptions namespace with a single class, EDNDecodeError, that inherits from ValueError. This mimicks Python’s json.decoder.JSONDecodeError.
Note that this is a breaking change, since code that catches SyntaxErrors to catch EDN issues won’t work anymore if it’s not changed to catch EDNDecodeErrors instead.
The current code raises
SyntaxError
on syntax errors. The problem with that is it’s impossible to catch EDN syntax errors and not other syntax errors. Also,SyntaxError
is raised by the Python parser on bad code.This PR adds a new
exceptions
namespace with a single class,EDNDecodeError
, that inherits fromValueError
. This mimicks Python’sjson.decoder.JSONDecodeError
.Note that this is a breaking change, since code that catches
SyntaxError
s to catch EDN issues won’t work anymore if it’s not changed to catchEDNDecodeError
s instead.