# Trying to set error details true

**URL:** <https://discourse.slimframework.com/t/trying-to-set-error-details-true/1648>\
**Category:** Questions\
**Created:** [July 6, 2017, 1:53am UTC](https://discourse.slimframework.com/t/trying-to-set-error-details-true/1648 "2017-07-06T01:53:48Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![rob\_blackwell](https://avatars.discourse-cdn.com/v4/letter/r/d2c977/32.png) [@rob\_blackwell](https://discourse.slimframework.com/u/rob_blackwell)\
**Post date:** [July 6, 2017, 1:53am UTC](https://discourse.slimframework.com/t/trying-to-set-error-details-true/1648/1 "2017-07-06T01:53:48Z")

</div>

I am probably going to feel dumb when someone comments on this but here goes:  
I just started experimenting with slim for an upcoming project and wanted to get some good error output - like stack traces while I make newbee mistakes. So from the online docs I tried

$configuration = [  
‘settings’ =\> [  
‘displayErrorDetails’ =\> true,  
],  
];  
$c = new \Slim\Container($configuration);  
$app = new \Slim\App($c);

But this throws an error since the Slim\App class constructor requires an array not a Slim\Container as its single argument.

So whats going - am I reading the wrong docs ?

So I tried passing the array $configuration to the Slim\App constructor, no joy still cryptic error messages.

If I hack the two error handlers to make the test

if ($this-\>displayErrorDetails || true)

I get useful error output. So I am on the right track with trying to configure the error handlers - but without more digging through the Slim dont know where in the config process I should change the displayErrorDetails flag.

Suggestions gratefully accepted

---

<div class="post-metadata">

**Author:** ![rob\_blackwell](https://avatars.discourse-cdn.com/v4/letter/r/d2c977/32.png) [@rob\_blackwell](https://discourse.slimframework.com/u/rob_blackwell)\
**Post date:** [July 6, 2017, 4:45am UTC](https://discourse.slimframework.com/t/trying-to-set-error-details-true/1648/2 "2017-07-06T04:45:26Z")

</div>

An update :

$configuration = [  
‘settings’ =\> [  
‘displayErrorDetails’ =\> true,  
],  
];  
$app = new \Slim\App($configuration[‘settings’]);

this is the config code that actually succeeds in turning on error details.

The other interesting thing I found by following the code through is that although ErrorHandle and phpErrorHandler are registered with the container they are never used from the container.

Slim\App creates instances of these two error handlers by itself and references the class name directly in doing so.

My guess is that the code is partway through a conversion to using the Container more widely and the active code for creating error handlers is still the “old stuff”.

---

<div class="post-metadata">

**Author:** ![damianopetrungaro](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.slimframework.com/damianopetrungaro/32/236_2.png) [@damianopetrungaro](https://discourse.slimframework.com/u/damianopetrungaro)\
**Post date:** [July 6, 2017, 7:41am UTC](https://discourse.slimframework.com/t/trying-to-set-error-details-true/1648/3 "2017-07-06T07:41:57Z")

</div>

The app does not accept only an array. It’s a default value. [As you can see](https://github.com/slimphp/Slim/blob/3.x/Slim/App.php#L74) you may pass a Container.

The `errorHandler` and `phpErrorHandler` are bind in the container [here](https://github.com/slimphp/Slim/blob/1365d127e899a931e6906fabd8ac2ae5eee928f8/Slim/Container.php#L72).

---

<div class="post-metadata">

**Author:** ![rob\_blackwell](https://avatars.discourse-cdn.com/v4/letter/r/d2c977/32.png) [@rob\_blackwell](https://discourse.slimframework.com/u/rob_blackwell)\
**Post date:** [July 6, 2017, 1:16pm UTC](https://discourse.slimframework.com/t/trying-to-set-error-details-true/1648/4 "2017-07-06T13:16:12Z")

</div>

Interesting - the Slim code I have installed does not look like your link. It looks like this:[https://github.com/slimphp/Slim/blob/4.x/Slim/App.php](https://github.com/slimphp/Slim/blob/4.x/Slim/App.php)

Seems to be a difference between the 3.x and 4.x branch. I tried to install 3.x with composer but got conflict errors so used 4.x.

---

<div class="post-metadata">

**Author:** ![damianopetrungaro](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.slimframework.com/damianopetrungaro/32/236_2.png) [@damianopetrungaro](https://discourse.slimframework.com/u/damianopetrungaro)\
**Post date:** [July 6, 2017, 1:20pm UTC](https://discourse.slimframework.com/t/trying-to-set-error-details-true/1648/5 "2017-07-06T13:20:12Z")

</div>

> [@rob\_blackwell](#):
>
> 4.x-dev

Please use 3.X instead, the 4 is a work in progress at the moment.
