aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYoichi Hirai <i@yoichihirai.com>2017-07-27 17:20:17 +0800
committerGitHub <noreply@github.com>2017-07-27 17:20:17 +0800
commit772de8c4d9cc58d8ad0ee8fc8e6252bd7cf184dc (patch)
tree2d7d480d083bb3aecefad32e1ac71f89ee24cb68
parent1298a8df14bd3dd6495aa38413208fa77781d4fd (diff)
parentf4b6bdad38ba82ad1d96f0ee669ca05c422010c0 (diff)
downloaddexon-solidity-772de8c4d9cc58d8ad0ee8fc8e6252bd7cf184dc.tar.gz
dexon-solidity-772de8c4d9cc58d8ad0ee8fc8e6252bd7cf184dc.tar.zst
dexon-solidity-772de8c4d9cc58d8ad0ee8fc8e6252bd7cf184dc.zip
Merge pull request #2646 from ethereum/standardcompiler
Clean up error catching in StandardCompiler
-rw-r--r--libsolidity/interface/StandardCompiler.cpp41
1 files changed, 23 insertions, 18 deletions
diff --git a/libsolidity/interface/StandardCompiler.cpp b/libsolidity/interface/StandardCompiler.cpp
index 23687340..dd135ce5 100644
--- a/libsolidity/interface/StandardCompiler.cpp
+++ b/libsolidity/interface/StandardCompiler.cpp
@@ -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)
{
- if (_error.type() == Error::Type::DocstringParsingError)
- errors.append(formatError(
- false,
- "DocstringParsingError",
- "general",
- "Documentation parsing error: " + *boost::get_error_info<errinfo_comment>(_error)
- ));
- else
- errors.append(formatErrorWithException(
- _error,
- false,
- _error.typeName(),
- "general",
- "",
- scannerFromSourceName
- ));
+ errors.append(formatErrorWithException(
+ _error,
+ false,
+ _error.typeName(),
+ "general",
+ "Uncaught error: ",
+ scannerFromSourceName
+ ));
+ }
+ /// This should not be leaked from compile().
+ catch (FatalError const& _exception)
+ {
+ errors.append(formatError(
+ false,
+ "FatalError",
+ "general",
+ "Uncaught fatal error: " + boost::diagnostic_information(_exception)
+ ));
}
catch (CompilerError const& _exception)
{
@@ -322,7 +325,8 @@ Json::Value StandardCompiler::compileInternal(Json::Value const& _input)
false,
"InternalCompilerError",
"general",
- "Internal compiler error (" + _exception.lineInfo() + ")", scannerFromSourceName
+ "Internal compiler error (" + _exception.lineInfo() + ")",
+ scannerFromSourceName
));
}
catch (UnimplementedFeatureError const& _exception)
@@ -333,7 +337,8 @@ Json::Value StandardCompiler::compileInternal(Json::Value const& _input)
"UnimplementedFeatureError",
"general",
"Unimplemented feature (" + _exception.lineInfo() + ")",
- scannerFromSourceName));
+ scannerFromSourceName
+ ));
}
catch (Exception const& _exception)
{