Add shortcuts for formatting error information

This commit is contained in:
mingchuan
2019-04-10 18:44:45 +08:00
parent ef3a18999c
commit f1374066af
13 changed files with 34 additions and 55 deletions
+11 -1
View File
@@ -25,6 +25,7 @@
#include <ostream>
#include <sstream>
#include <functional>
#include <liblangutil/Exceptions.h>
#include <liblangutil/SourceReferenceExtractor.h>
namespace dev
@@ -51,7 +52,16 @@ public:
virtual void printExceptionInformation(SourceReferenceExtractor::Message const& _msg);
virtual void printSourceLocation(SourceLocation const* _location);
virtual void printExceptionInformation(dev::Exception const& _error, std::string const& _category);
virtual void printExceptionInformation(dev::Exception const& _exception, std::string const& _category);
virtual void printErrorInformation(Error const& _error);
static std::string formatErrorInformation(Error const& _error)
{
return formatExceptionInformation(
_error,
(_error.type() == Error::Type::Warning) ? "Warning" : "Error"
);
}
static std::string formatExceptionInformation(
dev::Exception const& _exception,