{
package MyApp::Exception;
+ use overload
+ # Use the overloading thet HTTP::Exception uses
+ bool => sub { 1 }, '""' => 'as_string', fallback => 1;
+
sub new {
my ($class, $code, $headers, $body) = @_;
return bless +{res => [$code, $headers, $body]}, $class;
$responder->([$code, $headers, $body]);
};
}
+
+ sub as_string { 'bad stringy bad' }
package MyApp::Controller::Root;