Greetings Monks, Seekers, and Browsers.
When using LWP::UserAgent to access web sites, I note that it tries very hard to make things appear simple. Things are often not, however, actually simple. For instance: If the host returns a 500 error, LWP returns a 500 error to the caller. If the host doesn't answer, LWP returns a 500 error. This is not the truth. If you can't contact the host, you can't get an error code, including 500. If the host has no DNS entry, you get a 500 error. If the network is down, you get a 500 error. So you see where I am going. If you need to know what really happened, you have to follow-up every 500 error with some kind of troubleshooting. Same with a 400 error. If LWP doesn't like the URL, you get a 400 error just as if you had really contacted the host.
It occurs to me that LWP has to go through all the steps of contacting DNS, contacting the host, etc. So LWP must discover whether DNS is reachable, and whether there is a record for the host, and whether the host was actually contacted. It knows, but it won't say. I have expended a lot of time going through documentation (erm...) and code (yikes! The swamp is eating me alive!) at CPAN and can't find a solution.
So I ask you: Is there any way to get LWP to give up the information?