Skip to content

Kirby 3.8.4

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');
      }
    ]
  ]
];