diff --git a/posix/except.cpp b/posix/except.cpp index a45694b1..4feae9f2 100644 --- a/posix/except.cpp +++ b/posix/except.cpp @@ -11,7 +11,7 @@ * See the License for the specific language governing permissions and * limitations under the License. * - * Copyright 2010, 2017, + * Copyright 2010-2018 * Danny Robson */ @@ -98,6 +98,16 @@ error::throw_code (int code) } +/////////////////////////////////////////////////////////////////////////////// +const char* +error::what (void) const noexcept +{ + return strerror (m_code); +} + + + + /////////////////////////////////////////////////////////////////////////////// using util::posix::eai; diff --git a/posix/except.hpp b/posix/except.hpp index f3b03db6..fb75d913 100644 --- a/posix/except.hpp +++ b/posix/except.hpp @@ -11,7 +11,7 @@ * See the License for the specific language governing permissions and * limitations under the License. * - * Copyright 2010, 2017, + * Copyright 2010-2018 * Danny Robson */ @@ -39,6 +39,8 @@ namespace util::posix { static void throw_code [[gnu::noreturn]] (void); static void throw_code [[gnu::noreturn]] (int code); + virtual const char* what (void) const noexcept final override; + template static T try_value (T value) { @@ -48,7 +50,7 @@ namespace util::posix { } private: - int m_code; + int const m_code; };