Just for the curious, what was tge reason for the wantarray cleanup (sorry if thats a little OT)?
Shouldn't there be accessors for code and message. This currently looks a little messy, compared to the rest of the code mostly provides accessors for impotant attributes. Great work by the way! +rl Am 31.05.2014 03:19 schrieb "sri" <[email protected]>: > And one more thing, error handling in Mojo::UserAgent changed slightly > during the wantarray cleanup. > > my $tx = $ua->post('https://metacpan.org/search' => form => {q => > 'mojo'}); > if (my $res = $tx->success) { say $res->body } > else { > my ($msg, $code) = $tx->error; > die "$code} response: $msg" if $code}; > die "Connection error: $msg"; > } > > becomes > > my $tx = $ua->post('https://metacpan.org/search' => form => {q => > 'mojo'}); > if (my $res = $tx->success) { say $res->body } > else { > my $err = $tx->error; > die "$err->{code} response: $err->{message}" if $err->{code}; > die "Connection error: $err->{message}"; > } > > -- > sebastian > > -- > You received this message because you are subscribed to the Google Groups > "Mojolicious" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at http://groups.google.com/group/mojolicious. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Mojolicious" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/mojolicious. For more options, visit https://groups.google.com/d/optout.
