projects
/
catagits/Catalyst-Runtime.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
(parent:
9ffa230
)
Make exception stringify as their message.
Florian Ragwitz [Fri, 26 Jun 2009 15:27:05 +0000 (15:27 +0000)]
lib/Catalyst/Exception.pm
patch
|
blob
|
blame
|
history
diff --git
a/lib/Catalyst/Exception.pm
b/lib/Catalyst/Exception.pm
index
2af5ed0
..
4959e42
100644
(file)
--- a/
lib/Catalyst/Exception.pm
+++ b/
lib/Catalyst/Exception.pm
@@
-39,6
+39,13
@@
has message => (
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] ) : @_;