SourceReferenceFormatter: Support full range of options in formatErrorInformation()

This commit is contained in:
Kamil Śliwak
2023-08-11 14:15:56 +02:00
parent b7d2c8bb0a
commit 8407c8c615
4 changed files with 35 additions and 27 deletions
+4 -6
View File
@@ -85,12 +85,10 @@ std::optional<Error> parseAndReturnFirstError(
if (_allowWarnings && e->type() == Error::Type::Warning)
continue;
if (error)
{
string errors;
for (auto const& err: stack.errors())
errors += SourceReferenceFormatter::formatErrorInformation(*err, stack);
BOOST_FAIL("Found more than one error:\n" + errors);
}
BOOST_FAIL(
"Found more than one error:\n" +
SourceReferenceFormatter::formatErrorInformation(stack.errors(), stack)
);
error = e;
}
if (!success)
@@ -42,11 +42,10 @@ optional<CompilerOutput> SolidityCompilationFramework::compileContract()
if (m_compilerInput.debugFailure)
{
cerr << "Compiling contract failed" << endl;
for (auto const& error: m_compiler.errors())
cerr << SourceReferenceFormatter::formatErrorInformation(
*error,
m_compiler
);
cerr << SourceReferenceFormatter::formatErrorInformation(
m_compiler.errors(),
m_compiler
);
}
return {};
}