Permalink
Browse files

Merge pull request #3 from ctfliblime/master

Pass HTTP::Exception objects back up the chain
  • Loading branch information...
beppu committed Jun 16, 2011
2 parents 3f54e5a + bf7e6cf commit dc56bb3bd9b34073691e9758ff5516dd7a7cd639
Showing with 3 additions and 2 deletions.
  1. +1 −0 lib/Squatting.pm
  2. +2 −2 lib/Squatting/Controller.pm
View
@@ -139,6 +139,7 @@ sub service {
my $content;
eval { $content = $c->$method(@args) };
die $@ if (ref($@) =~ /^HTTP::Exception/); # Pass HTTP::Exceptions on up
warn "EXCEPTION: $@" if ($@);
my $cookies = $c->cookies;
@@ -30,12 +30,12 @@ sub clone {
# view - name of default view
# log - logging object
# app - name of our app
for my $m qw(name urls cr env input cookies state v status headers log view app) {
for my $m (qw(name urls cr env input cookies state v status headers log view app)) {
*{$m} = sub : lvalue { $_[0]->{$m} }
}
# HTTP methods
for my $m qw(get post head put delete options trace connect) {
for my $m (qw(get post head put delete options trace connect)) {
*{$m} = sub { $_[0]->{$m}->(@_) }
}

0 comments on commit dc56bb3

Please sign in to comment.