From ce3082dec2178273d4913a6f9df909c0aca8ef5a Mon Sep 17 00:00:00 2001 From: Rhett Aultman Date: Sun, 27 Nov 2016 18:46:44 -0800 Subject: [PATCH] Tidy up the error message --- libsolidity/interface/CompilerStack.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libsolidity/interface/CompilerStack.cpp b/libsolidity/interface/CompilerStack.cpp index dded81f5f..dd5188607 100644 --- a/libsolidity/interface/CompilerStack.cpp +++ b/libsolidity/interface/CompilerStack.cpp @@ -184,10 +184,10 @@ bool CompilerStack::parse() { const ContractDefinition* existingContract = m_contracts.find(contract->name())->second.contract; if (contract != existingContract) - BOOST_THROW_EXCEPTION(CompilerError() << + BOOST_THROW_EXCEPTION(DeclarationError() << errinfo_sourceLocation(contract->location()) << - errinfo_comment(contract->name() + " is already defined at " - + *(existingContract->location().sourceName))); + errinfo_comment(contract->name() + " is already defined.") << + errinfo_secondarySourceLocation(SecondarySourceLocation().append(existingContract->location()), "Previous definition is here:")); } m_contracts[contract->name()].contract = contract; }