http://qs321.pair.com?node_id=1213003


in reply to Reacting to Mojo::UserAgent Errors

Maybe Arogs are getting wise to you :P From the FAQ: What does "Inactivity timeout" mean? What does "Premature connection close" mean?, the Mojo::UserAgent has an example or response handling:

use Mojo::UserAgent; # Fine grained response handling (dies on connection errors) my $ua = Mojo::UserAgent->new; my $res = $ua->get('mojolicious.org/perldoc')->result; if ($res->is_success) { say $res->body } elsif ($res->is_error) { say $res->message } elsif ($res->code == 301) { say $res->headers->location } else { say 'Whatever...' }