From: J. Shirley Date: Thu, 22 Nov 2007 19:48:08 +0000 (+0000) Subject: Adding comment for confusing Return::Value usage X-Git-Tag: v0.14~14 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=2a175229402f4ffd8d80da5ca80a5e231354c653;hp=9a222f27707be85c92d3c9a65364d83fa3b56c95;p=catagits%2FCatalyst-View-Email.git Adding comment for confusing Return::Value usage --- diff --git a/lib/Catalyst/View/Email.pm b/lib/Catalyst/View/Email.pm index ff74039..73bc44f 100644 --- a/lib/Catalyst/View/Email.pm +++ b/lib/Catalyst/View/Email.pm @@ -113,7 +113,7 @@ an array reference. ], }; -=head1 HANDLING FAILURES +=head1 HANDLING ERRORS If the email fails to send, the view will die (throw an exception). After your forward to the view, it is a good idea to check for errors: @@ -237,6 +237,8 @@ sub process { if ( $message ) { my $return = $self->mailer->send($message); + # return is a Return::Value object, so this will stringify as the error + # in the case of a failure. croak "$return" if !$return; } else { croak "Unable to create message";