Populate the sourceLocation field properly in standard JSON on errors

This commit is contained in:
Alex Beregszaszi
2017-12-18 12:17:51 +00:00
parent 3d1830f3f2
commit add4cde68c
3 changed files with 43 additions and 2 deletions
+2 -2
View File
@@ -81,15 +81,15 @@ Json::Value formatErrorWithException(
else
message = _message;
Json::Value sourceLocation;
if (location && location->sourceName)
{
Json::Value sourceLocation = Json::objectValue;
sourceLocation["file"] = *location->sourceName;
sourceLocation["start"] = location->start;
sourceLocation["end"] = location->end;
}
return formatError(_warning, _type, _component, message, formattedMessage, location);
return formatError(_warning, _type, _component, message, formattedMessage, sourceLocation);
}
set<string> requestedContractNames(Json::Value const& _outputSelection)