[Catalyst-commits] r10670 - Catalyst-Runtime/5.80/trunk/lib/Catalyst

rafl at dev.catalyst.perl.org rafl at dev.catalyst.perl.org
Fri Jun 26 15:27:05 GMT 2009


Author: rafl
Date: 2009-06-26 15:27:05 +0000 (Fri, 26 Jun 2009)
New Revision: 10670

Modified:
   Catalyst-Runtime/5.80/trunk/lib/Catalyst/Exception.pm
Log:
Make exception stringify as their message.

Modified: Catalyst-Runtime/5.80/trunk/lib/Catalyst/Exception.pm
===================================================================
--- Catalyst-Runtime/5.80/trunk/lib/Catalyst/Exception.pm	2009-06-26 15:26:56 UTC (rev 10669)
+++ Catalyst-Runtime/5.80/trunk/lib/Catalyst/Exception.pm	2009-06-26 15:27:05 UTC (rev 10670)
@@ -39,6 +39,13 @@
     isa => 'Str',
 );
 
+use overload q{""} => \&as_string;
+
+sub as_string {
+    my ($self) = @_;
+    return $self->message;
+}
+
 sub throw {
     my $class  = shift;
     my %params = @_ == 1 ? ( error => $_[0] ) : @_;




More information about the Catalyst-commits mailing list