Merge pull request #3009 from ethereum/refactor-exception-what

Refactor Exception::what()
This commit is contained in:
chriseth 2017-10-04 11:30:07 +02:00 committed by GitHub
commit 0c3888aba2

View File

@ -24,12 +24,14 @@ using namespace dev;
char const* Exception::what() const noexcept
{
// Return the comment if available.
if (string const* cmt = comment())
return cmt->c_str();
else
/// Boost accepts nullptr, but the C++ standard doesn't
/// and crashes on some platforms.
return std::exception::what();
return cmt->data();
// Fallback to base what().
// Boost accepts nullptr, but the C++ standard doesn't
// and crashes on some platforms.
return std::exception::what();
}
string Exception::lineInfo() const