TestAppsErrorController.php 577 B

1234567891011121314151617181920212223
  1. <?php
  2. declare(strict_types=1);
  3. namespace TestApp\Controller;
  4. use Cake\Controller\ErrorController;
  5. use Cake\Http\Response;
  6. use TestApp\Error\Exception\MissingWidgetThingException;
  7. class TestAppsErrorController extends ErrorController
  8. {
  9. protected function missingWidgetThing(MissingWidgetThingException $exception)
  10. {
  11. assert($this->viewBuilder()->getVar('error') === $exception);
  12. $this->viewBuilder()->setLayout('default');
  13. }
  14. protected function xml()
  15. {
  16. return new Response(['body' => '<xml>rendered xml exception</xml>']);
  17. }
  18. }