mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #2646 from ethereum/standardcompiler
Clean up error catching in StandardCompiler
This commit is contained in:
commit
772de8c4d9
@ -285,24 +285,27 @@ Json::Value StandardCompiler::compileInternal(Json::Value const& _input)
|
|||||||
));
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/// This is only thrown in a very few locations.
|
||||||
catch (Error const& _error)
|
catch (Error const& _error)
|
||||||
{
|
{
|
||||||
if (_error.type() == Error::Type::DocstringParsingError)
|
errors.append(formatErrorWithException(
|
||||||
errors.append(formatError(
|
_error,
|
||||||
false,
|
false,
|
||||||
"DocstringParsingError",
|
_error.typeName(),
|
||||||
"general",
|
"general",
|
||||||
"Documentation parsing error: " + *boost::get_error_info<errinfo_comment>(_error)
|
"Uncaught error: ",
|
||||||
));
|
scannerFromSourceName
|
||||||
else
|
));
|
||||||
errors.append(formatErrorWithException(
|
}
|
||||||
_error,
|
/// This should not be leaked from compile().
|
||||||
false,
|
catch (FatalError const& _exception)
|
||||||
_error.typeName(),
|
{
|
||||||
"general",
|
errors.append(formatError(
|
||||||
"",
|
false,
|
||||||
scannerFromSourceName
|
"FatalError",
|
||||||
));
|
"general",
|
||||||
|
"Uncaught fatal error: " + boost::diagnostic_information(_exception)
|
||||||
|
));
|
||||||
}
|
}
|
||||||
catch (CompilerError const& _exception)
|
catch (CompilerError const& _exception)
|
||||||
{
|
{
|
||||||
@ -322,7 +325,8 @@ Json::Value StandardCompiler::compileInternal(Json::Value const& _input)
|
|||||||
false,
|
false,
|
||||||
"InternalCompilerError",
|
"InternalCompilerError",
|
||||||
"general",
|
"general",
|
||||||
"Internal compiler error (" + _exception.lineInfo() + ")", scannerFromSourceName
|
"Internal compiler error (" + _exception.lineInfo() + ")",
|
||||||
|
scannerFromSourceName
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
catch (UnimplementedFeatureError const& _exception)
|
catch (UnimplementedFeatureError const& _exception)
|
||||||
@ -333,7 +337,8 @@ Json::Value StandardCompiler::compileInternal(Json::Value const& _input)
|
|||||||
"UnimplementedFeatureError",
|
"UnimplementedFeatureError",
|
||||||
"general",
|
"general",
|
||||||
"Unimplemented feature (" + _exception.lineInfo() + ")",
|
"Unimplemented feature (" + _exception.lineInfo() + ")",
|
||||||
scannerFromSourceName));
|
scannerFromSourceName
|
||||||
|
));
|
||||||
}
|
}
|
||||||
catch (Exception const& _exception)
|
catch (Exception const& _exception)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user