Skip to content

Commit

Permalink
link to success method in description of error method
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed May 29, 2014
1 parent 862b766 commit 81ea5fa
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
7 changes: 3 additions & 4 deletions lib/Mojo/Transaction.pm
Expand Up @@ -214,7 +214,7 @@ Connection identifier or socket.
my $err = $tx->error;
Error and code.
Transaction error, commonly used together with L</"success">.
=head2 is_finished
Expand Down Expand Up @@ -279,9 +279,8 @@ message in L</"error">, 400 and 500 responses also a code.
if (my $res = $tx->success) { say $res->body }
else {
my $err = $tx->error;
say $err->{code}
? "$err->{code} response: $err->{msg}"
: "Connection error: $err->{msg}";
die "$err->{code} response: $err->{msg}" if $err->{code};
die "Connection error: $err->{msg}";
}
=head1 SEE ALSO
Expand Down
5 changes: 2 additions & 3 deletions lib/Mojo/UserAgent.pm
Expand Up @@ -392,9 +392,8 @@ Mojo::UserAgent - Non-blocking I/O HTTP and WebSocket user agent
if (my $res = $tx->success) { say $res->body }
else {
my $err = $tx->error;
say $err->{code}
? "$err->{code} response: $err->{msg}"
: "Connection error: $err->{msg}";
die "$err->{code} response: $err->{msg}" if $err->{code};
die "Connection error: $err->{msg}";
}
# Quick JSON API request with Basic authentication
Expand Down

0 comments on commit 81ea5fa

Please sign in to comment.