From 28c6bd7af73a6675859582193c7e04af692d50e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Leclercq?= Date: Thu, 30 Aug 2018 12:10:33 +0200 Subject: [PATCH] Network: Log internal errors --- src/Nazara/Network/Posix/SocketImpl.cpp | 11 +++++------ src/Nazara/Network/Win32/SocketImpl.cpp | 11 +++++------ 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/src/Nazara/Network/Posix/SocketImpl.cpp b/src/Nazara/Network/Posix/SocketImpl.cpp index 7f94f5a9d..f82e992ca 100644 --- a/src/Nazara/Network/Posix/SocketImpl.cpp +++ b/src/Nazara/Network/Posix/SocketImpl.cpp @@ -952,6 +952,11 @@ namespace Nz case EFAULT: case ENOTSOCK: case EPROTOTYPE: + // Those are not errors and should have been handled + case EALREADY: + case EISCONN: + case EWOULDBLOCK: + NazaraWarning("Internal error occurred: " + Error::GetLastSystemError(error) + " (" + String::Number(error) + ')'); return SocketError_Internal; case EADDRNOTAVAIL: @@ -965,12 +970,6 @@ namespace Nz case ESOCKTNOSUPPORT: return SocketError_NotSupported; - // Those are not errors and should have been handled before the call - case EALREADY: - case EISCONN: - case EWOULDBLOCK: - return SocketError_Internal; - case ECONNREFUSED: return SocketError_ConnectionRefused; diff --git a/src/Nazara/Network/Win32/SocketImpl.cpp b/src/Nazara/Network/Win32/SocketImpl.cpp index 097927dc6..f503fa4d8 100644 --- a/src/Nazara/Network/Win32/SocketImpl.cpp +++ b/src/Nazara/Network/Win32/SocketImpl.cpp @@ -951,6 +951,11 @@ namespace Nz case WSAENOTSOCK: case WSAEPROTOTYPE: case WSA_INVALID_HANDLE: + // Those are not errors and should have been handled + case WSAEALREADY: + case WSAEISCONN: + case WSAEWOULDBLOCK: + NazaraWarning("Internal error occurred: " + Error::GetLastSystemError(error) + " (" + String::Number(error) + ')'); return SocketError_Internal; case WSAEADDRNOTAVAIL: @@ -964,12 +969,6 @@ namespace Nz case WSAESOCKTNOSUPPORT: return SocketError_NotSupported; - // Those are not errors and should have been handled before the call - case WSAEALREADY: - case WSAEISCONN: - case WSAEWOULDBLOCK: - return SocketError_Internal; - case WSAECONNREFUSED: return SocketError_ConnectionRefused;