mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Refactor Exception::what()
This commit is contained in:
parent
e7cea2f684
commit
931c0bcce3
@ -24,12 +24,14 @@ using namespace dev;
|
|||||||
|
|
||||||
char const* Exception::what() const noexcept
|
char const* Exception::what() const noexcept
|
||||||
{
|
{
|
||||||
|
// Return the comment if available.
|
||||||
if (string const* cmt = comment())
|
if (string const* cmt = comment())
|
||||||
return cmt->c_str();
|
return cmt->data();
|
||||||
else
|
|
||||||
/// Boost accepts nullptr, but the C++ standard doesn't
|
// Fallback to base what().
|
||||||
/// and crashes on some platforms.
|
// Boost accepts nullptr, but the C++ standard doesn't
|
||||||
return std::exception::what();
|
// and crashes on some platforms.
|
||||||
|
return std::exception::what();
|
||||||
}
|
}
|
||||||
|
|
||||||
string Exception::lineInfo() const
|
string Exception::lineInfo() const
|
||||||
|
Loading…
Reference in New Issue
Block a user