diff --git a/include/boost/beast/_experimental/test/impl/error.ipp b/include/boost/beast/_experimental/test/impl/error.ipp index f4447137..45d2030d 100644 --- a/include/boost/beast/_experimental/test/impl/error.ipp +++ b/include/boost/beast/_experimental/test/impl/error.ipp @@ -29,8 +29,8 @@ public: } BOOST_BEAST_DECL - std::string - message(int ev) const override + char const* + message(int ev, char*, std::size_t) const noexcept override { switch(static_cast(ev)) { @@ -40,6 +40,13 @@ public: } } + BOOST_BEAST_DECL + std::string + message(int ev) const override + { + return message(ev, nullptr, 0); + } + BOOST_BEAST_DECL error_condition default_error_condition(int ev) const noexcept override diff --git a/include/boost/beast/core/impl/error.ipp b/include/boost/beast/core/impl/error.ipp index 4cf43d76..a5f51b84 100644 --- a/include/boost/beast/core/impl/error.ipp +++ b/include/boost/beast/core/impl/error.ipp @@ -28,10 +28,9 @@ public: error_codes() : error_category(0x002f6e94401c6e8bu) {} - BOOST_BEAST_DECL - std::string - message(int ev) const override + char const* + message(int ev, char*, std::size_t) const noexcept override { switch(static_cast(ev)) { @@ -41,6 +40,13 @@ public: } } + BOOST_BEAST_DECL + std::string + message(int ev) const override + { + return message(ev, nullptr, 0); + } + BOOST_BEAST_DECL error_condition default_error_condition(int ev) const noexcept override @@ -67,10 +73,9 @@ public: error_conditions() : error_category(0x3dd0b0ce843c5b10u) {} - BOOST_BEAST_DECL - std::string - message(int cv) const override + char const* + message(int cv, char*, std::size_t) const noexcept override { switch(static_cast(cv)) { @@ -79,6 +84,13 @@ public: return "The operation timed out"; } } + + BOOST_BEAST_DECL + std::string + message(int cv) const override + { + return message(cv, nullptr, 0); + } }; } // detail diff --git a/include/boost/beast/http/impl/error.ipp b/include/boost/beast/http/impl/error.ipp index c1ee2366..2e7c7ba4 100644 --- a/include/boost/beast/http/impl/error.ipp +++ b/include/boost/beast/http/impl/error.ipp @@ -29,8 +29,9 @@ public: http_error_category() : error_category(0x964627da815bf210u) {} - std::string - message(int ev) const override + BOOST_BEAST_DECL + char const* + message(int ev, char*, std::size_t) const noexcept override { switch(static_cast(ev)) { @@ -66,6 +67,12 @@ public: } } + std::string + message(int ev) const override + { + return message(ev, nullptr, 0); + } + error_condition default_error_condition( int ev) const noexcept override diff --git a/include/boost/beast/websocket/impl/error.ipp b/include/boost/beast/websocket/impl/error.ipp index 7256a464..bb2bf318 100644 --- a/include/boost/beast/websocket/impl/error.ipp +++ b/include/boost/beast/websocket/impl/error.ipp @@ -29,8 +29,9 @@ public: return "boost.beast.websocket"; } - std::string - message(int ev) const override + BOOST_BEAST_DECL + char const* + message(int ev, char*, std::size_t) const noexcept override { switch(static_cast(ev)) { @@ -71,6 +72,12 @@ public: } } + std::string + message(int ev) const override + { + return message(ev, nullptr, 0); + } + error_condition default_error_condition(int ev) const noexcept override { @@ -128,9 +135,9 @@ public: error_conditions() : error_category(0x7a8de5d61799ce9eu) {} - - std::string - message(int cv) const override + BOOST_BEAST_DECL + char const* + message(int cv, char*, std::size_t) const noexcept override { switch(static_cast(cv)) { @@ -139,6 +146,12 @@ public: case condition::protocol_violation: return "A WebSocket protocol violation occurred"; } } + + std::string + message(int cv) const override + { + return message(cv, nullptr, 0); + } }; } // detail diff --git a/include/boost/beast/zlib/impl/error.ipp b/include/boost/beast/zlib/impl/error.ipp index f6b02316..f112c34a 100644 --- a/include/boost/beast/zlib/impl/error.ipp +++ b/include/boost/beast/zlib/impl/error.ipp @@ -55,8 +55,9 @@ public: return "boost.beast.zlib"; } - std::string - message(int ev) const override + BOOST_BEAST_DECL + char const* + message(int ev, char*, std::size_t) const noexcept override { switch(static_cast(ev)) { @@ -84,6 +85,12 @@ public: } } + std::string + message(int ev) const override + { + return message(ev, nullptr, 0); + } + error_condition default_error_condition(int ev) const noexcept override { diff --git a/test/beast/core/error.cpp b/test/beast/core/error.cpp index 40d9de9f..7b319bdb 100644 --- a/test/beast/core/error.cpp +++ b/test/beast/core/error.cpp @@ -34,12 +34,14 @@ public: BEAST_EXPECT(ec.category().name() != nullptr); BEAST_EXPECT(! ec.message().empty()); BEAST_EXPECT(ec == c); + BEAST_EXPECT(ec.message(nullptr, 0) != nullptr); } { auto ec = make_error_condition(c); BEAST_EXPECT(ec.category().name() != nullptr); BEAST_EXPECT(! ec.message().empty()); BEAST_EXPECT(ec == c); + BEAST_EXPECT(ec.message(nullptr, 0) != nullptr); } } diff --git a/test/beast/http/error.cpp b/test/beast/http/error.cpp index 248f1cf9..33833af9 100644 --- a/test/beast/http/error.cpp +++ b/test/beast/http/error.cpp @@ -36,6 +36,8 @@ public: static_cast::type>(ev)))); BEAST_EXPECT(cat.equivalent(ec, static_cast::type>(ev))); + + BEAST_EXPECT(ec.message(nullptr, 0) != nullptr); } void diff --git a/test/beast/websocket/error.cpp b/test/beast/websocket/error.cpp index 2a272184..0e7e6e2f 100644 --- a/test/beast/websocket/error.cpp +++ b/test/beast/websocket/error.cpp @@ -35,6 +35,9 @@ public: BEAST_EXPECT(ec.category().name() != nullptr); BEAST_EXPECT(! ec.message().empty()); BEAST_EXPECT(ec == c); + + BEAST_EXPECT(ec.message(nullptr, 0) != nullptr); + BEAST_EXPECT(make_error_condition(c).message(nullptr, 0) != nullptr); } void run() override diff --git a/test/beast/zlib/error.cpp b/test/beast/zlib/error.cpp index f9096e6e..2f408e08 100644 --- a/test/beast/zlib/error.cpp +++ b/test/beast/zlib/error.cpp @@ -35,6 +35,8 @@ public: static_cast::type>(ev)))); BEAST_EXPECT(cat.equivalent(ec, static_cast::type>(ev))); + + BEAST_EXPECT(ec.message(nullptr, 0) != nullptr); } void run() override