# Custom Error Rendering

**URL:** <https://discourse.cakephp.org/t/custom-error-rendering/11587>\
**Category:** Need Help\
**Tags:** release, help\
**Created:** [October 20, 2023, 9:39pm UTC](https://discourse.cakephp.org/t/custom-error-rendering/11587 "2023-10-20T21:39:02Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dlares](https://avatars.discourse-cdn.com/v4/letter/d/ecae2f/32.png) [@dlares](https://discourse.cakephp.org/u/dlares)\
**Post date:** [October 20, 2023, 9:39pm UTC](https://discourse.cakephp.org/t/custom-error-rendering/11587/1 "2023-10-20T21:39:02Z")

</div>

## Hello Everyone

I am developing an application where I need the errors to be presented in a certain way.

In CakePHP 4, I was able to do this simply by implementing a `Custom ExceptionRenderer`.

### Problem

However, in CakePHP 5 I am encountering an error that I can’t seem to resolve:

```plaintext
Uncaught Cake\Error\FatalErrorException: [InvalidArgumentException] Cannot use `App\Error\CustomErrorRenderer` as an `exceptionRenderer`. It must be an instance of `Cake\Error\ExceptionRendererInterface`

Even when using the example provided in the CakePHP 5 documentation, I still can't solve it.

Reference
Here is the page I am referring to:

CakePHP 5 Documentation on Custom ExceptionRenderer

Thank you very much for your time.
```

---

<div class="post-metadata">

**Author:** ![KevinPfeifer](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/kevinpfeifer/32/3365_2.png) [@KevinPfeifer](https://discourse.cakephp.org/u/KevinPfeifer)\
**Post date:** [October 21, 2023, 1:11pm UTC](https://discourse.cakephp.org/t/custom-error-rendering/11587/2 "2023-10-21T13:11:47Z")

</div>

are you sure your custom class implements `Cake\Error\ExceptionRendererInterface`?

See e.g. [https://github.com/dereuromark/cakephp-whoops/blob/master/src/Error/WhoopsExceptionRenderer.php](https://github.com/dereuromark/cakephp-whoops/blob/master/src/Error/WhoopsExceptionRenderer.php) which also works fine for cake5
