23 Apr
2012
23 Apr
'12
7:01 a.m.
Can someone help me find an example of how to use Dancer::Error and Dancer::Response. This code (based on man Dancer::Error) gets runtime error "can't find object method set via package Dancer::Response" ------- code --- get 'quux' => sub { err_not_found ( 'quux' ) }; sub err_not_found { my $path = shift; my $error = Dancer::Error->new( code => 404, content => "No such file: $path", ); Dancer::Response->set($error->render); } ---------------- Thanks, Joel -- Joel Roth