Skip to content

Kirby 3.5.7.1

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