Use MooseX::Role::WithOverloading.
[catagits/Catalyst-Runtime.git] / lib / Catalyst / Exception / Interface.pm
index 1bd603a..9b9c421 100644 (file)
@@ -1,7 +1,11 @@
 package Catalyst::Exception::Interface;
 
-use Moose::Role;
-use namespace::autoclean;
+use MooseX::Role::WithOverloading;
+use namespace::clean -except => 'meta';
+
+use overload
+    q{""}    => sub { $_[0]->as_string },
+    fallback => 1;
 
 requires qw/as_string throw rethrow/;