From 7a24a5764edf728f0caa14e7aa8f832d7e6f42e3 Mon Sep 17 00:00:00 2001 From: chriseth Date: Fri, 24 Feb 2017 19:31:20 +0100 Subject: Add line info to serious exceptions. --- libdevcore/Exceptions.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'libdevcore') diff --git a/libdevcore/Exceptions.h b/libdevcore/Exceptions.h index 4622774a..37cdbed9 100644 --- a/libdevcore/Exceptions.h +++ b/libdevcore/Exceptions.h @@ -41,6 +41,9 @@ struct Exception: virtual std::exception, virtual boost::exception Exception(std::string _message = std::string()): m_message(std::move(_message)) {} const char* what() const noexcept override { return m_message.empty() ? std::exception::what() : m_message.c_str(); } + /// @returns "FileName:LineNumber" referring to the point where the exception was thrown. + std::string lineInfo() const; + private: std::string m_message; }; -- cgit v1.2.3