Skip to content

Commit

Permalink
small optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Aug 8, 2013
1 parent 786af75 commit b43248e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
3 changes: 1 addition & 2 deletions Changes
@@ -1,7 +1,6 @@

4.24 2013-08-08
- Fixed small bug where Mojo::IOLoop::Stream timeout was not always
available.
- Fixed bug where Mojo::IOLoop::Stream timeout was not always available.

4.23 2013-08-01
- Added redirects method to Mojo::Transaction::HTTP.
Expand Down
13 changes: 5 additions & 8 deletions lib/Mojo/UserAgent.pm
Expand Up @@ -287,15 +287,12 @@ sub _finish {
my $res = $tx->res;
if (my $err = $res->error) { $res->error($err) }

else {

# Premature connection close
if ($close && !$res->code) { $res->error('Premature connection close') }
# Premature connection close
elsif ($close && !$res->code) { $res->error('Premature connection close') }

# 400/500
elsif ($res->is_status_class(400) || $res->is_status_class(500)) {
$res->error($res->message, $res->code);
}
# 400/500
elsif ($res->is_status_class(400) || $res->is_status_class(500)) {
$res->error($res->message, $res->code);
}

$self->$cb($tx);
Expand Down

0 comments on commit b43248e

Please sign in to comment.