Closed Fanor51 closed 2 years ago
Hi Fabio,
thanks for the report. It's already fixed in 4.1.1. Feel free to reopen the issue if something is missing.
Hello @christophlehmann,
i have installed now version 4.1.1 over composer 2 an still getting this error ->
1/1) TypeError Networkteam\SentryClient\Client::captureException(): Argument #1 ($exception) must be of type Throwable, string given, called in /var/www/html/public/typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php on line 5381
in /var/www/html/public/typo3conf/ext/sentry_client/Classes/Client.php line 70
return false;
}
public static function captureException(\Throwable $exception): ?EventId <---
{
if (self::init() && ExceptionBlacklistService::shouldHandleException($exception)) {
$eventId = captureException($exception);
return $eventId;
at Networkteam\SentryClient\Client::captureException('', array('userFunc' => 'Networkteam\SentryClient\Client->captureException'), object(TYPO3\CMS\Core\Http\ServerRequest)) in /var/www/html/public/typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php line 5381
// Extensions should either drop the property altogether if they don't need current instance
// of ContentObjectRenderer, or set the property to protected and use the setter above.
$classObj->cObj = $this;
}
$content = $callable($content, $conf, $this->getRequest()); <---
} else {
$this->getTimeTracker()->setTSlogMessage('Method "' . $parts[1] . '" did not exist in class "' . $parts[0] . '"', LogLevel::ERROR);
}
} else {
This error comes from the testing TYPOSCRIPT ->
page = PAGE
page.20 = USER
page.20 {
userFunc = Networkteam\SentryClient\Client->captureException
}
I now an exception throw is intended with this but this seems to me like there is something wrong before the actual wanted exception get throwed.
Thanks for the help and best regards! Fabio
The Type Error due to the testing code is intended behaviour. You can read it like "call any function that produces an error"
Will update the docs.
Hello,
i coudn´t find any PHP recommendation so i want to ask if the extension is compatible with PHP 8.0 in combination with TYPO3 11. In my case if get the followed exception:
Fatal error: Uncaught TYPO3\CMS\Core\Error\Exception: PHP Warning: Undefined array key "X-REQUEST-ID" in /var/www/html/public/typo3conf/ext/sentry_client/Classes/Client.php line 129 in /var/www/html/public/typo3/sysext/core/Classes/Error/ErrorHandler.php:137 Stack trace: #0 /var/www/html/vendor/sentry/sentry/src/ErrorHandler.php(305): TYPO3\CMS\Core\Error\ErrorHandler->handleError(2, 'Undefined array...', '/var/www/html/p...', 129, Array) #1 /var/www/html/public/typo3conf/ext/sentry_client/Classes/Client.php(129): Sentry\ErrorHandler->handleError(2, 'Undefined array...', '/var/www/html/p...', 129) #2 /var/www/html/vendor/sentry/sentry/src/State/Hub.php(104): Networkteam\SentryClient\Client::Networkteam\SentryClient\{closure}(Object(Sentry\State\Scope)) #3 /var/www/html/vendor/sentry/sentry/src/functions.php(87): Sentry\State\Hub->configureScope(Object(Closure)) #4 /var/www/html/public/typo3conf/ext/sentry_client/Classes/Client.php(137): Sentry\configureScope(Object(Closure)) #5 /var/www/html/public/typo3conf/ext/sentry_client/Classes/Client.php(62): Networkteam\SentryClient\Client::setTagsContext() #6 /var/www/html/public/typo3conf/ext/sentry_client/Classes/Client.php(73): Networkteam\SentryClient\Client::init() #7 /var/www/html/public/typo3conf/ext/sentry_client/Classes/DebugExceptionHandler.php(13): Networkteam\SentryClient\Client::captureException(Object(TypeError)) #8 [internal function]: Networkteam\SentryClient\DebugExceptionHandler->handleException(Object(TypeError)) #9 {main} thrown in /var/www/html/public/typo3/sysext/core/Classes/Error/ErrorHandler.php on line 137
I tried to debug the place with something like this:
protected static function setTagsContext(): void
but then i got new errors in "Networkteam\SentryClient\Client::captureException"
(1/1) TypeError Networkteam\SentryClient\Client::captureException(): Argument #1 ($exception) must be of type Throwable, string given, called in /var/www/html/public/typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php on line 5381
at Networkteam\SentryClient\Client::captureException('', array('userFunc' => 'Networkteam\\SentryClient\\Client->captureException'), object(TYPO3\CMS\Core\Http\ServerRequest))
So i just want to ask if its compatible or if i got any errors in my configuration. The system i use was on TYPO9 and PHP 7.2 and got updated to TYPO 11 with PHP 8. In the old version the sentry integration worked perfectly.
The error can be reproduced with the throw exception TYPOSCRIPT config from your read.me.
If this wasn´t intended to work with PHP 8.0 i can try to fix the issues by myself and create a pull request if i get it done.
Best regards Fabio
Edit: used Version -> networkteam/sentry-client 4.1.0