error.hpp 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. //
  2. // Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com)
  3. //
  4. // Distributed under the Boost Software License, Version 1.0. (See accompanying
  5. // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  6. //
  7. // Official repository: https://github.com/boostorg/beast
  8. //
  9. #ifndef BOOST_BEAST_TEST_DETAIL_ERROR_HPP
  10. #define BOOST_BEAST_TEST_DETAIL_ERROR_HPP
  11. #include <boost/beast/core/error.hpp>
  12. #include <boost/beast/core/string.hpp>
  13. namespace boost {
  14. namespace beast {
  15. namespace test {
  16. enum class error;
  17. } // test
  18. } // beast
  19. namespace system {
  20. template<>
  21. struct is_error_code_enum<beast::test::error>
  22. {
  23. static bool const value = true;
  24. };
  25. } // system
  26. namespace beast {
  27. namespace test {
  28. namespace detail {
  29. class error_codes : public error_category
  30. {
  31. public:
  32. const char*
  33. name() const noexcept override;
  34. std::string
  35. message(int ev) const override;
  36. error_condition
  37. default_error_condition(int ev) const noexcept override;
  38. };
  39. } // detail
  40. error_code
  41. make_error_code(error e);
  42. } // test
  43. } // beast
  44. } // boost
  45. #endif