%perl>
Odin::set_mason_failproc $m;
Odin::cgi_who $r;
Odin::fetch_cookies $r;
$r->content_type("text/html; charset=utf8");
$m->call_next;
%perl>
%#
<%method wrapper>\
% $r->header_out(Status => $status) if defined $status;
<& SELF:header &>
\
% defined $title ? $m->print($title) : $m->comp("SELF:title");
<% $m->content %>
<%args>
$status => undef
$title => undef
%args>
%method>
%#
<%method title>(Untitled page)%method>
<%method header>%method>
%#
<%method error>\
<&| SELF:wrapper, status => $status, title => $title // $m->content &>\
\
% if (defined $title) {
Error: <% $title %>\
% } else {
Error\
% }
<% $m->content %>
&>
<%args>
$status => 500
$title => undef
%args>
%method>
%#
<%once>
use utf8;
use Odin;
%once>