From: Aaron Trevena Date: Tue, 25 Apr 2006 13:19:47 +0000 (+0000) Subject: changed error code constant, and related test X-Git-Tag: 2.11~37 X-Git-Url: https://git.decadent.org.uk/gitweb/?a=commitdiff_plain;h=b1dc5246c8917c4d0e11c154537c902baa654c84;p=maypole.git changed error code constant, and related test git-svn-id: http://svn.maypole.perl.org/Maypole/trunk@483 48953598-375a-da11-a14b-00016c27c3ee --- diff --git a/META.yml b/META.yml index 3ffa96d..f1692a3 100644 --- a/META.yml +++ b/META.yml @@ -1,7 +1,7 @@ # http://module-build.sourceforge.net/META-spec.html #XXXXXXX This is a prototype!!! It will change in the future!!! XXXXX# name: Maypole -version: 2.11_pre1 +version: 2.11_pre2 version_from: lib/Maypole.pm installdirs: site requires: @@ -11,7 +11,6 @@ requires: CGI::Untaint::email: 0 Class::DBI: 0.96 Class::DBI::AbstractSearch: 0 - Class::DBI::AsForm: 2.2 Class::DBI::FromCGI: 0.94 Class::DBI::Loader: 0.02 Class::DBI::Loader::Relationship: 0 diff --git a/lib/Maypole.pm b/lib/Maypole.pm index ab05605..b1e066d 100644 --- a/lib/Maypole.pm +++ b/lib/Maypole.pm @@ -453,20 +453,14 @@ sub handler : method { $self->status(Maypole::Constants::OK()); # set the default $self->__call_hook('start_request_hook'); return $self->status unless $self->status == Maypole::Constants::OK(); - die "status undefined after start_request_hook()" unless defined $self->status; - $self->get_session; $self->get_user; - my $status = $self->handler_guts; - return $status unless $status == OK; - # TODO: require send_output to return a status code $self->send_output; - return $status; } diff --git a/lib/Maypole/Constants.pm b/lib/Maypole/Constants.pm index 09e7d4b..cee418f 100644 --- a/lib/Maypole/Constants.pm +++ b/lib/Maypole/Constants.pm @@ -3,7 +3,7 @@ use strict; use base 'Exporter'; use constant OK => 0; use constant DECLINED => -1; -use constant ERROR => -1; +use constant ERROR => 500; our @EXPORT = qw(OK DECLINED ERROR); our $VERSION = "1." . sprintf "%04d", q$Rev$ =~ /: (\d+)/; diff --git a/t/constants.t b/t/constants.t index 89759c7..1e70cd4 100755 --- a/t/constants.t +++ b/t/constants.t @@ -8,6 +8,6 @@ ok($Maypole::Constants::VERSION, 'defines $VERSION'); is(\&OK, \&Maypole::Constants::OK, 'exports OK'); is(OK(), 0, 'OK correctly defined'); is(\&ERROR, \&Maypole::Constants::ERROR, 'exports ERROR'); -is(ERROR(), -1, 'ERROR correctly defined'); +is(ERROR(), 500, 'ERROR correctly defined'); is(\&DECLINED, \&Maypole::Constants::DECLINED, 'exports DECLINED'); is(DECLINED(), -1, 'DECLINED correctly defined');