Skip to content

Commit 58a45f2

Browse files
authored
Better API for repe requests (#1528)
* Better API for repe requests * new REPE error handling * asio_repe_client * fix header order * Update glaze_asio.hpp * remove internal repe::request * error handling for socket resolve failure * remove <format> * Make input argument to request 3rd item * Change field order in encode_error * better errors * Update glaze_asio.hpp * asio_repe_client -> asio_client * only expose call to asio_client * Use booleans for notify, read, write, in user_header * better errors * recieve_buffer and send_buffer no longer throw * check error_code * Update glaze_asio.hpp * read/write proxies for async_string and unit tests * updating unit tests * Update repe_test.cpp * Update repe_test.cpp * Update multi-threading test and run * Update repe_test.cpp
1 parent 02aae82 commit 58a45f2

File tree

8 files changed

+527
-322
lines changed

8 files changed

+527
-322
lines changed

include/glaze/core/reflect.hpp

+10-5
Original file line numberDiff line numberDiff line change
@@ -1920,6 +1920,16 @@ namespace glz::detail
19201920

19211921
namespace glz
19221922
{
1923+
[[nodiscard]] inline std::string format_error(const error_code& ec)
1924+
{
1925+
return std::string{meta<error_code>::keys[uint32_t(ec)]};
1926+
}
1927+
1928+
[[nodiscard]] inline std::string format_error(const error_ctx& pe)
1929+
{
1930+
return std::string{meta<error_code>::keys[uint32_t(pe.ec)]};
1931+
}
1932+
19231933
[[nodiscard]] inline std::string format_error(const error_ctx& pe, const auto& buffer)
19241934
{
19251935
const auto error_type_str = meta<error_code>::keys[uint32_t(pe.ec)];
@@ -1943,11 +1953,6 @@ namespace glz
19431953
}
19441954
}
19451955

1946-
[[nodiscard]] inline std::string format_error(const error_ctx& pe)
1947-
{
1948-
return std::string{meta<error_code>::keys[uint32_t(pe.ec)]};
1949-
}
1950-
19511956
template <class T>
19521957
[[nodiscard]] std::string format_error(const expected<T, error_ctx>& pe)
19531958
{

0 commit comments

Comments
 (0)