diff --git a/lib/Cro/HTTP/Router.pm6 b/lib/Cro/HTTP/Router.pm6 index ed76f0a..1162b0e 100644 --- a/lib/Cro/HTTP/Router.pm6 +++ b/lib/Cro/HTTP/Router.pm6 @@ -1068,6 +1068,36 @@ module Cro::HTTP::Router { content $content-type, $body, |%options; } + proto server-error(|) is export {*} + + #| Produce a HTTP 500 Server Error response + multi server-error(--> Nil) { + set-status(500, :action); + } + + #| Produce a HTTP 500 Server Error response. The remaining arguments will be + #| passed to the content function, setting the media type, response body, and + #| other options. + multi server-error($content-type, $body, *%options --> Nil) { + set-status(500, :action); + content $content-type, $body, |%options; + } + + proto not-supported(|) is export {*} + + #| Produce a HTTP 505 Not Supported response + multi not-supported(--> Nil) { + set-status(505, :action); + } + + #| Produce a HTTP 505 Not Supported response. The remaining arguments will be + #| passed to the content function, setting the media type, response body, and + #| other options. + multi not-supported($content-type, $body, *%options --> Nil) { + set-status(505, :action); + content $content-type, $body, |%options; + } + #| Add a cookie to the response sub set-cookie($name, $value, *%opts) is export { my $resp = $*CRO-ROUTER-RESPONSE //