Closed christophlehmann closed 10 months ago
@christophlehmann, is this catching of "Allowed memory size ..." actually working in 5.1.1? Because I got nothing in Sentry on those incidents ;-(
I implemented something like this in config/system/additional.php
to have them be reported to a Slack channel...
function shutdown()
{
if ($error = error_get_last()) {
if (str_contains($error['message'], 'Allowed memory size')) {
$error['environment'] = (string)\TYPO3\CMS\Core\Core\Environment::getContext();
$error['url'] = "https://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
// Slack webhook via cURL.
...
exit();
}
}
}
register_shutdown_function('shutdown');
Maybe something like this could be implemented into EXT:sentry_client?
Sentry has an Integration for catching Errors that occur when reaching
memory_limit
. Currently this is not active. The client needs to be setup earlier.