From a2f6e73122cf612599c637acd3fb038450fde38c Mon Sep 17 00:00:00 2001 From: SChernykh Date: Mon, 30 Aug 2021 14:28:23 +0200 Subject: [PATCH] JSONRPCRequest: more informative error messages --- src/json_rpc_request.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/json_rpc_request.cpp b/src/json_rpc_request.cpp index 6f25a7e..1f56b46 100644 --- a/src/json_rpc_request.cpp +++ b/src/json_rpc_request.cpp @@ -64,7 +64,7 @@ void JSONRPCRequest::on_connect(uv_connect_t* req, int status) JSONRPCRequest* pThis = static_cast(req->data); if (status != 0) { - LOGERR(1, "failed to connect, status = " << status); + LOGERR(1, "failed to connect, error " << uv_err_name(status)); pThis->close(); return; } @@ -81,7 +81,7 @@ void JSONRPCRequest::on_write(uv_write_t* handle, int status) JSONRPCRequest* pThis = static_cast(handle->data); if (status != 0) { - LOGERR(1, "failed to send request, status = " << status); + LOGERR(1, "failed to send request, error " << uv_err_name(status)); pThis->close(); return; } @@ -112,7 +112,7 @@ void JSONRPCRequest::on_read(uv_stream_t* stream, ssize_t nread, const uv_buf_t* } else if (nread < 0) { if (nread != UV_EOF){ - LOGERR(1, "failed to read response, err = " << uv_err_name(static_cast(nread))); + LOGERR(1, "failed to read response, error " << uv_err_name(static_cast(nread))); } pThis->close(); }