My application builds dynamic reports created by the users, which may produce queries that return division by zero.  

When this happens ZF2 catches that with `Zend\Db\Adapter\Exception\InvalidQueryException` to display the exception and stop my script.

I need to continue the script execution even when that happens, because the application will show `0` in those calculations and the report will still be shown.

I already disabled these settings in `config/autoload/local.php` and am sure the `global.php` isn't overwriting them:

```
'phpSettings'   => array(
    'display_startup_errors' => false,
    'display_errors'         => false,
    'error_reporting'        => 0,
),

'view_manager' => array(
    'display_not_found_reason' => false,
    'display_exceptions'       => false,
),

```

The script still stops and show my custom "error" page, the only difference is that it hides exception details.

How can I keep the script/application running even when the `division by zero` occurs?

I already saw other questions talking about `display_exceptions=false` but as you can see it didn't help me. 

I would prefer a solution without making changes to the query creation process, because it is very complex, but am acepting all suggestions.