diff --git a/client/src/core/windows/request.cc b/client/src/core/windows/request.cc index 7178271..9f6e260 100644 --- a/client/src/core/windows/request.cc +++ b/client/src/core/windows/request.cc @@ -152,7 +152,22 @@ // It´s an error, extract message in.block[in.used] = 0; debug("Error was ",rc," (\"",(const char *) (in.block + in.current),"\")"); - throw std::system_error(std::error_code(rc,std::system_category()),(const char *) (in.block + in.current)); + + // Overload system error mostly because of the lack of ENOTCONN message on windows. + class Error : public std::system_error { + private: + std::string message; + + public: + Error(int rc, const char *msg) : std::system_error((int) rc, std::generic_category()), message(msg) { + } + + const char *what() const noexcept override { + return message.c_str(); + } + }; + + throw Error(rc, (const char *) (in.block + in.current)); } diff --git a/server/src/core/methods/methods.c b/server/src/core/methods/methods.c index d84aba3..5427363 100644 --- a/server/src/core/methods/methods.c +++ b/server/src/core/methods/methods.c @@ -89,7 +89,7 @@ int ipc3270_method_call(GObject *object, const gchar *method_name, GVariant *req if(!g_ascii_strcasecmp(methods[ix].name,method_name)) { #ifdef _DEBUG_ - g_message("Calling %s",methods[ix].name); + lib3270_write_log(hSession,"IPC","Calling %s",methods[ix].name); #endif // _DEBUG_ int rc = methods[ix].call(object,request,response,error); @@ -99,7 +99,7 @@ int ipc3270_method_call(GObject *object, const gchar *method_name, GVariant *req if(rc) { debug("%s exits with rc=%d (%s)",methods[ix].name,rc,ipc3270_get_error_message(rc)); - g_message("%s exits with rc=%d (%s)",methods[ix].name,rc,ipc3270_get_error_message(rc)); + lib3270_write_log(hSession,"IPC","%s exits with rc=%d (%s)",methods[ix].name,rc,ipc3270_get_error_message(rc)); ipc3270_set_error(object,rc,error); debug("Error Message was set to %s",(*error)->message); } -- libgit2 0.21.2