https://github.com/netlogix/nxerrorhandler
Error handler with static pages for TYPO3
https://github.com/netlogix/nxerrorhandler
php sentry typo3
Last synced: about 2 months ago
JSON representation
Error handler with static pages for TYPO3
- Host: GitHub
- URL: https://github.com/netlogix/nxerrorhandler
- Owner: netlogix
- Created: 2022-05-27T08:03:52.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2024-04-26T03:00:21.000Z (about 1 year ago)
- Last Synced: 2024-04-26T04:22:43.842Z (about 1 year ago)
- Topics: php, sentry, typo3
- Language: PHP
- Size: 112 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# TYPO3 extension nxerrorhandler
[](https://github.com/netlogix/nxerrorhandler)
[](https://get.typo3.org/version/12)
[](https://php.net/)
[](https://github.com/netlogix/nxerrorhandler/actions)Improves error handling in TYPO3 by using statically rendered error documents for output to reduce strain on the server.
This extension is a work in progress.
## Usage
Add this to your `config/system/settings.php`
```php
return [
'EXTENSIONS' => [
'nxerrorhandler' => [
'exceptionHandlerComponents' => [
\Netlogix\Nxerrorhandler\ErrorHandler\Component\ExtbaseArgumentsToBadRequestComponent::class,
\Netlogix\Nxerrorhandler\ErrorHandler\Component\StaticDocumentComponent::class,
],
]
],
'SYS' => [
'productionExceptionHandler' => \Netlogix\Nxerrorhandler\ErrorHandler\GeneralExceptionHandler::class
],
];
```Note: This will register the ExceptionHandler for all contexts including backend
requests. If you want to restrict it to frontend requests only then add this
line to `config/system/additional.php` instead:```php
if (TYPO3_REQUESTTYPE & TYPO3_REQUESTTYPE_FE) {
$GLOBALS['TYPO3_CONF_VARS']['SYS']['productionExceptionHandler'] = \Netlogix\Nxerrorhandler\ErrorHandler\GeneralExceptionHandler::class;
}
```Add this to your `config/sites/sitename/config.yaml`
```yaml
errorHandling:
- errorCode: '400'
errorHandler: PHP
errorPhpClassFQCN: Netlogix\Nxerrorhandler\Error\PageContentErrorHandler
errorContentSource: 't3://page?uid=99'
- errorCode: '404'
errorHandler: PHP
errorPhpClassFQCN: Netlogix\Nxerrorhandler\Error\PageContentErrorHandler
errorContentSource: 't3://page?uid=99'
- errorCode: '500'
errorHandler: PHP
errorPhpClassFQCN: Netlogix\Nxerrorhandler\Error\PageContentErrorHandler
errorContentSource: 't3://page?uid=99'
```