# HG changeset patch # User Alain Mazy # Date 1757669292 -7200 # Node ID 1f07e38a804fbc7c5b6562ad206d9b0706852884 # Parent 1486ee6d0a70579d633529dfebea3984117bffeb reformat HTTP error details diff -r 1486ee6d0a70 -r 1f07e38a804f OrthancFramework/Sources/HttpServer/HttpServer.cpp --- a/OrthancFramework/Sources/HttpServer/HttpServer.cpp Thu Sep 11 18:50:09 2025 +0200 +++ b/OrthancFramework/Sources/HttpServer/HttpServer.cpp Fri Sep 12 11:28:12 2025 +0200 @@ -1893,8 +1893,23 @@ } else { + std::string errorMsgDetails; + if (bindAddresses_.empty()) + { + errorMsgDetails = "port " + port; + } + else + { + errorMsgDetails = listeningPorts; + } + + if (errno != 0) // there might be additionnal details about the error in errno + { + errorMsgDetails += ", errno = " + boost::lexical_cast(errno) + ", " + strerror(errno); + } + throw OrthancException(ErrorCode_HttpPortInUse, - " (" + listeningPorts + ")"); + " (" + errorMsgDetails + ")"); } } @@ -1906,7 +1921,7 @@ } #endif - CLOG(WARNING, HTTP) << "HTTP server listening on : " << listeningPorts + CLOG(WARNING, HTTP) << "HTTP server listening on" << (bindAddresses_.empty() ? " port: " + port : ": " + listeningPorts) << " (HTTPS encryption is " << (IsSslEnabled() ? "enabled" : "disabled") << ", remote access is "