mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Introduce formatExceptionInformation
This commit is contained in:
parent
fefb3fad6f
commit
b1db6eac8b
@ -23,6 +23,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <ostream>
|
||||
#include <sstream>
|
||||
#include <functional>
|
||||
#include <libevmasm/SourceLocation.h>
|
||||
|
||||
@ -53,6 +54,16 @@ public:
|
||||
std::string const& _name,
|
||||
ScannerFromSourceNameFun const& _scannerFromSourceName
|
||||
);
|
||||
static std::string formatExceptionInformation(
|
||||
Exception const& _exception,
|
||||
std::string const& _name,
|
||||
ScannerFromSourceNameFun const& _scannerFromSourceName
|
||||
)
|
||||
{
|
||||
std::ostringstream errorOutput;
|
||||
printExceptionInformation(errorOutput, _exception, _name, _scannerFromSourceName);
|
||||
return errorOutput.str();
|
||||
}
|
||||
private:
|
||||
/// Prints source name if location is given.
|
||||
static void printSourceName(
|
||||
|
@ -56,9 +56,7 @@ string formatError(
|
||||
function<Scanner const&(string const&)> const& _scannerFromSourceName
|
||||
)
|
||||
{
|
||||
ostringstream errorOutput;
|
||||
SourceReferenceFormatter::printExceptionInformation(errorOutput, _exception, _name, _scannerFromSourceName);
|
||||
return errorOutput.str();
|
||||
return SourceReferenceFormatter::formatExceptionInformation(_exception, _name, _scannerFromSourceName);
|
||||
}
|
||||
|
||||
Json::Value functionHashes(ContractDefinition const& _contract)
|
||||
|
Loading…
Reference in New Issue
Block a user