From: Yuval Kogman Date: Thu, 23 Mar 2006 14:10:24 +0000 (+0000) Subject: Add the clear_errors method X-Git-Tag: 5.7099_04~664 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=commitdiff_plain;h=ca81eb671ce5f08854acab82cf46c17a64801ce6;hp=9ecc267238aa4b8b7e09ef834c08f5a7b5351771 Add the clear_errors method --- diff --git a/lib/Catalyst.pm b/lib/Catalyst.pm index 702f056..1a7e76c 100644 --- a/lib/Catalyst.pm +++ b/lib/Catalyst.pm @@ -291,11 +291,6 @@ Add a new error. $c->error('Something bad happened'); -Clear errors. You probably don't want to clear the errors unless you are -implementing a custom error screen. - - $c->error(0); - =cut sub error { @@ -308,6 +303,22 @@ sub error { return $c->{error} || []; } +=head2 $c->clear_errors + +Clear errors. You probably don't want to clear the errors unless you are +implementing a custom error screen. + +This is equivalent to running + + $c->error(0); + +=cut + +sub clear_errors { + my $c = shift; + $c->error(0); +} + =head2 $c->response =head2 $c->res