diff options
author | chriseth <c@ethdev.com> | 2015-10-15 23:27:32 +0800 |
---|---|---|
committer | chriseth <c@ethdev.com> | 2015-10-15 23:27:32 +0800 |
commit | e1e6a0c5319925f1f92f64279081c71738571272 (patch) | |
tree | ef22def14ff7b3d69d552a63f4f022e8bac05d18 /solc/jsonCompiler.cpp | |
parent | e11e10f8176cd6f866e78b5d12c86fe77367c64a (diff) | |
parent | b2e787b803ffc4a3f13b8578f7029543bd665aed (diff) | |
download | dexon-solidity-e1e6a0c5319925f1f92f64279081c71738571272.tar dexon-solidity-e1e6a0c5319925f1f92f64279081c71738571272.tar.gz dexon-solidity-e1e6a0c5319925f1f92f64279081c71738571272.tar.bz2 dexon-solidity-e1e6a0c5319925f1f92f64279081c71738571272.tar.lz dexon-solidity-e1e6a0c5319925f1f92f64279081c71738571272.tar.xz dexon-solidity-e1e6a0c5319925f1f92f64279081c71738571272.tar.zst dexon-solidity-e1e6a0c5319925f1f92f64279081c71738571272.zip |
Merge pull request #134 from LianaHus/sol_error_types_refuctoring
Sol error types refuctoring
Diffstat (limited to 'solc/jsonCompiler.cpp')
-rw-r--r-- | solc/jsonCompiler.cpp | 21 |
1 files changed, 6 insertions, 15 deletions
diff --git a/solc/jsonCompiler.cpp b/solc/jsonCompiler.cpp index 00fd0370..0746fc88 100644 --- a/solc/jsonCompiler.cpp +++ b/solc/jsonCompiler.cpp @@ -127,24 +127,19 @@ string compile(string _input, bool _optimize) { bool succ = compiler.compile(_input, _optimize); for (auto const& error: compiler.errors()) + { + auto err = dynamic_pointer_cast<Error const>(error); errors.append(formatError( *error, - (dynamic_pointer_cast<Warning const>(error)) ? "Warning" : "Error", + (err->type() == Error::Type::Warning) ? "Warning" : "Error", compiler )); + } success = succ; // keep success false on exception } - catch (ParserError const& exception) - { - errors.append(formatError(exception, "Parser error", compiler)); - } - catch (DeclarationError const& exception) + catch (Error const& error) { - errors.append(formatError(exception, "Declaration error", compiler)); - } - catch (TypeError const& exception) - { - errors.append(formatError(exception, "Type error", compiler)); + errors.append(formatError(error, error.typeName(), compiler)); } catch (CompilerError const& exception) { @@ -154,10 +149,6 @@ string compile(string _input, bool _optimize) { errors.append(formatError(exception, "Internal compiler error", compiler)); } - catch (DocstringParsingError const& exception) - { - errors.append(formatError(exception, "Documentation parsing error", compiler)); - } catch (Exception const& exception) { errors.append("Exception during compilation: " + boost::diagnostic_information(exception)); |