1 // Copyright Leandro Lucarella 2008 - 2010.
2 // Distributed under the Boost Software License, Version 1.0.
3 // (See accompanying file COPYING or copy at
4 // http://www.boost.org/LICENSE_1_0.txt)
7 #ifndef POSIXX_ERROR_HPP_
8 #define POSIXX_ERROR_HPP_
20 struct error: std::runtime_error
23 /// Default constructor, gets the error number and string from errno.
27 * Constructor with a more detailed message.
29 * @param where Description about where the error was thrown.
31 explicit error(const std::string& where) throw ();
36 /// Error number, as of errno.
45 posixx::error::error() throw():
46 std::runtime_error(strerror(errno)), no(errno)
51 posixx::error::error(const std::string& where) throw ():
52 std::runtime_error(where + ": " + strerror(errno)), no(errno)
57 posixx::error::~error() throw ()
61 #endif // POSIXX_ERROR_HPP_