projects
/
catagits/Catalyst-Runtime.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
Make exception stringify as their message.
[catagits/Catalyst-Runtime.git]
/
lib
/
Catalyst
/
Exception.pm
diff --git
a/lib/Catalyst/Exception.pm
b/lib/Catalyst/Exception.pm
index
d50adf9
..
4959e42
100644
(file)
--- a/
lib/Catalyst/Exception.pm
+++ b/
lib/Catalyst/Exception.pm
@@
-34,6
+34,18
@@
Throws a fatal exception.
=cut
+has message => (
+ is => 'ro',
+ 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] ) : @_;