Closed Pet3ris closed 4 years ago
Yeah, this seems like a great idea.
The data sent to stdout
is always JSON formatted, so something like exc.error_data = json.loads(stdoutdata)["errors"]
should work to allow easier access.
Will be included in the upcoming v1.0
release.
Overview
I'm trying to extract line ranges and individual errors from Solidity error messages but it seems like
SolcError
collapses all that information into one string. Would it perhaps be useful to preserve thecompiler_output["errors"]
variable for this purpose?Specification
One easy way would be to add a new entry for compiler errors into
SolcError
like so:This would still allow people to use existing arguments to the exception without change.