As it presently stands, the ConnectionException is thrown when opening a socket fails and contains the system-level error code and message. This information, however, is only accessible if the throwConnectionExceptions flag is set and the original exception is propagated to the consumer. If the exception is disabled, then a user warning will be created using the trigger_error() function, which unfortunately does not carry an information from the exception, leading to inability to properly debug connection issues. With this change the original exception message will be appended to the produced warning.
Before
StatsD server connection failed (udp://hostdoesnotexiststalleverlol.stupidtld:8125)
After
StatsD server connection failed (udp://hostdoesnotexiststalleverlol.stupidtld:8125): (0) php_network_getaddresses: getaddrinfo failed: Name or service not known
What & Why?
As it presently stands, the
ConnectionException
is thrown when opening a socket fails and contains the system-level error code and message. This information, however, is only accessible if thethrowConnectionExceptions
flag is set and the original exception is propagated to the consumer. If the exception is disabled, then a user warning will be created using thetrigger_error()
function, which unfortunately does not carry an information from the exception, leading to inability to properly debug connection issues. With this change the original exception message will be appended to the produced warning.Before
After