Exception handler

The core component of this extension is to modify the default debug exception handler from TYPO3 core. For this, the \EliasHaeussler\Typo3Solver\Error\AiSolverExceptionHandler class is shipped with the extension.

Configuration

In order to active the modified exception handler, it must be explicitly configured at $GLOBALS['TYPO3_CONF_VARS']['SYS']['debugExceptionHandler'] . This can be done in the system configuration file config/system/settings.php (formerly public/typo3conf/LocalConfiguration.php):

config/system/settings.php
return [
    'SYS' => [
        'debugExceptionHandler' => 'EliasHaeussler\\Typo3Solver\\Error\\AiSolverExceptionHandler',
    ],
];
Copied!

Once configured, the exception handler tries to provide a solution for the current exception and shows it on the exception page. Depending on the handled exception, there are various types of problem solving.

Types of problem solving

Streamed solution

This variant is automatically used if an exception is triggered in a stage where TYPO3 bootstrapping is already done and therefore a service container exists. In this case, the solution is provided asynchronous from an event stream by a custom middleware /tx_solver/solution.

Video showing a solution stream on an error page

Solution stream on error page

Default solution

There are cases where solution streaming is not possible. For example, if the exception to handle was triggered very early in the bootstrapping process. Those cases prevent solution streaming as it requires a functioning bootstrapping and a successfully built service container.

If solution streaming is not possible, the solution is provided synchronous. This way is less convenient because – depending on the configured attributes – requests to OpenAI may take relatively long, up to several minutes. During the request, no actions can be done as it would interrupt the request and therefore abort problem solving.

Error page with a synchronously provided solution

Default solution on error page