aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/interface
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2017-04-10 21:46:59 +0800
committerGitHub <noreply@github.com>2017-04-10 21:46:59 +0800
commitbd48f181b588978461fb4651839c62bcac7888d4 (patch)
tree67b9086edb190114119348536bb839dfe7470499 /libsolidity/interface
parent8cbe87b4089bfb19dafd0b700586eaeeda30e271 (diff)
parenta182dfe26695b24704047265cbe1cac80d0f8a83 (diff)
downloaddexon-solidity-bd48f181b588978461fb4651839c62bcac7888d4.tar.gz
dexon-solidity-bd48f181b588978461fb4651839c62bcac7888d4.tar.zst
dexon-solidity-bd48f181b588978461fb4651839c62bcac7888d4.zip
Merge pull request #2098 from ethereum/sourceformatter
Introduce formatExceptionInformation
Diffstat (limited to 'libsolidity/interface')
-rw-r--r--libsolidity/interface/SourceReferenceFormatter.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/libsolidity/interface/SourceReferenceFormatter.h b/libsolidity/interface/SourceReferenceFormatter.h
index 7034f4ab..e8676d60 100644
--- a/libsolidity/interface/SourceReferenceFormatter.h
+++ b/libsolidity/interface/SourceReferenceFormatter.h
@@ -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(