punktDe / sentry-flow

Sentry client package for the Flow framework
Other
4 stars 2 forks source link

The option "environment" with value false is expected to be of type "null" or "string", but is of type "bool". #7

Closed kdambekalns closed 4 years ago

kdambekalns commented 4 years ago

In https://github.com/punktDe/sentry-flow/blob/88417874ab1ad0933cb4fc1956c6c01fe001dbd7/Classes/Handler/ErrorHandler.php#L72 when the value in $settings['environment'] is false (e.g. when using env var substitution but no variable is defined), that is used and leads to The option "environment" with value false is expected to be of type "null" or "string", but is of type "bool".

This instead works:

$settings['environment'] ? $settings['environment'] : ''

(see https://3v4l.org/8j0bt)

Exception in line 895 of /…/Packages/Libraries/symfony/options-resolver/OptionsResolver.php: The option "environment" with value false is expected to be of type "null" or "string", but is of type "bool".

47 Symfony\Component\OptionsResolver\OptionsResolver::offsetGet()
46 Symfony\Component\OptionsResolver\OptionsResolver::resolve()
45 Sentry\Options::__construct()
44 Sentry\ClientBuilder::create()
43 PunktDe\Sentry\Flow\Handler\ErrorHandler_Original::initializeObject()
42 PunktDe\Sentry\Flow\Handler\ErrorHandler::__construct()
41 Neos\Flow\ObjectManagement\ObjectManager::instantiateClass()
40 Neos\Flow\ObjectManagement\ObjectManager::get()
39 PunktDe\Sentry\Neos\Aspect\FusionHandlerAspect::PunktDe\Sentry\Neos\Aspect\{closure}()
38 Closure::__invoke()
37 Neos\Flow\ObjectManagement\DependencyInjection\DependencyProxy::_activateDependency()
36 Neos\Flow\ObjectManagement\DependencyInjection\DependencyProxy::__call()
35 PunktDe\Sentry\Neos\Aspect\FusionHandlerAspect_Original::captureException()
…
fnkr commented 4 years ago

Thanks for the bug report, fixed in v3.4.2.