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
|
#pragma once
|
||||||
|
|
||||||
#include <ostream>
|
#include <ostream>
|
||||||
|
#include <sstream>
|
||||||
#include <functional>
|
#include <functional>
|
||||||
#include <libevmasm/SourceLocation.h>
|
#include <libevmasm/SourceLocation.h>
|
||||||
|
|
||||||
@ -53,6 +54,16 @@ public:
|
|||||||
std::string const& _name,
|
std::string const& _name,
|
||||||
ScannerFromSourceNameFun const& _scannerFromSourceName
|
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:
|
private:
|
||||||
/// Prints source name if location is given.
|
/// Prints source name if location is given.
|
||||||
static void printSourceName(
|
static void printSourceName(
|
||||||
|
@ -56,9 +56,7 @@ string formatError(
|
|||||||
function<Scanner const&(string const&)> const& _scannerFromSourceName
|
function<Scanner const&(string const&)> const& _scannerFromSourceName
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
ostringstream errorOutput;
|
return SourceReferenceFormatter::formatExceptionInformation(_exception, _name, _scannerFromSourceName);
|
||||||
SourceReferenceFormatter::printExceptionInformation(errorOutput, _exception, _name, _scannerFromSourceName);
|
|
||||||
return errorOutput.str();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Json::Value functionHashes(ContractDefinition const& _contract)
|
Json::Value functionHashes(ContractDefinition const& _contract)
|
||||||
|
Loading…
Reference in New Issue
Block a user