diff options
author | Alex Beregszaszi <alex@rtfs.hu> | 2017-03-30 05:40:10 +0800 |
---|---|---|
committer | Alex Beregszaszi <alex@rtfs.hu> | 2017-04-10 21:07:36 +0800 |
commit | b1db6eac8b298967b73e3f09c75f12f566b3074c (patch) | |
tree | 3b2659cec44947d79c60f903c43ab84e27c92734 /libsolidity/interface | |
parent | fefb3fad6fa20b9c99dd987a7869c297b279032e (diff) | |
download | dexon-solidity-b1db6eac8b298967b73e3f09c75f12f566b3074c.tar.gz dexon-solidity-b1db6eac8b298967b73e3f09c75f12f566b3074c.tar.zst dexon-solidity-b1db6eac8b298967b73e3f09c75f12f566b3074c.zip |
Introduce formatExceptionInformation
Diffstat (limited to 'libsolidity/interface')
-rw-r--r-- | libsolidity/interface/SourceReferenceFormatter.h | 11 |
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( |