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...' }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Reacting to Mojo::UserAgent Errors
by AlwaysSurprised (Novice) on Apr 16, 2018 at 23:51 UTC | |
by marto (Cardinal) on Apr 17, 2018 at 03:42 UTC | |
by rizzo (Curate) on Apr 17, 2018 at 21:59 UTC | |
by AlwaysSurprised (Novice) on Apr 18, 2018 at 15:06 UTC | |
|
Re^2: Reacting to Mojo::UserAgent Errors
by AlwaysSurprised (Novice) on Apr 21, 2018 at 23:52 UTC |