No such thing as a small change | |
PerlMonks |
Re^2: Reacting to Mojo::UserAgent Errorsby AlwaysSurprised (Novice) |
on Apr 16, 2018 at 23:51 UTC ( [id://1213030]=note: print w/replies, xml ) | Need Help?? |
Perhaps they have wised to me, but at 5 URL/s they don't seem to have taken offence. It would be nice if Mojo::UserAgent allowed the useragent details to be set, but that doesn't appear to be the case. I have read from the book of Mojolicious at the temple of CPAN and the code you cite but I can't get it to work (or not work). I haven't found specific details so I interpret the if tree to be "look for 200" (aka is_success is a 200 response code), if not look for a connection problem (aka is_error means the GET timesout for some reason). Specifically, if I run
with the correct URL, it works correctly and spits out the perldoc page and the extra message. Nowif I misspell the URL, like I have above, I'll get a "Can't connect: No such host is known" message but it doesn't show the "Got to the end" message i.e. the script terminates at is_error and I can't recover and move on. Am I missing something here?
In Section
Seekers of Perl Wisdom
|
|