This changeset improves error messages for failed connections. In particular, failed TCP/IP connections using the happy eyeballs connector (the default) or the old DNS connector will now report the hostname once at the beginning of the message and will not show its internal hostname parameter multiple times:
- Connection to tcp://localhost:80 failed: Last error for IPv4: Connection to tcp://127.0.0.1:80?hostname=localhost failed: Connection refused. Previous error for IPv6: Connection to tcp://[::1]:80?hostname=localhost failed: Connection refused + Connection to tcp://localhost:80 failed: Last error for IPv4: Connection to tcp://127.0.0.1:80 failed: Connection refused. Previous error for IPv6: Connection to tcp://[::1]:80 failed: Connection refused
Likewise, we now make sure to always consistently include the URI scheme used in the error message. For instance, failed TLS connections will now include the appropriate URI scheme for the start of the message and show the underlying URI scheme for underlying TCP/IP connection issues such as this:
- Connection to localhost:443 failed: Last error for IPv4: Connection to tcp://127.0.0.1:443?hostname=localhost failed: Connection refused. Previous error for IPv6: Connection to tcp://[::1]:443?hostname=localhost failed: Connection refused + Connection to tls://localhost:443 failed: Last error for IPv4: Connection to tcp://127.0.0.1:443 failed: Connection refused. Previous error for IPv6: Connection to tcp://[::1]:443 failed: Connection refused
Builds on top of #265, #266, #267 and others such as clue/reactphp-redis#116, friends-of-reactphp/mysql#141 and more