Skip to content

Kirby 4.5.0

Exception

Throwing exceptions will automatically invoke the error page with a matching HTTP status code.

/site/config/config.php
return [
  'routes' => [
    [
      'pattern' => 'custom/response',
      'action'  => function () {
        throw new Exception('Something went horribly wrong');
      }
    ]
  ]
];