Add the clear_errors method
Yuval Kogman [Thu, 23 Mar 2006 14:10:24 +0000 (14:10 +0000)]
lib/Catalyst.pm

index 702f056..1a7e76c 100644 (file)
@@ -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