netlogix / nxerrorhandler
Error handler with static pages for TYPO3
Installs: 10 352
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 3
Forks: 0
Open Issues: 3
Type:typo3-cms-extension
Requires
- php: ^8.1
- typo3/cms-core: ^12.4
- typo3/cms-extbase: ^12.4
- typo3/cms-frontend: ^12.4
Requires (Dev)
- ext-sqlite3: *
- netlogix/coding-guidelines-php: ^1.0
- phpunit/phpcov: ^9.0
- ssch/typo3-rector: ^1.5
- typo3/testing-framework: ^8.0
Suggests
- netlogix/nxsentry: Send errors and exceptions to sentry
This package is auto-updated.
Last update: 2024-10-29 18:58:15 UTC
README
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
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:
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
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'