pimcore-dynamic-search icon indicating copy to clipboard operation
pimcore-dynamic-search copied to clipboard

[Bug] Cryptic error message due to wrong parameter typehint

Open scrummer opened this issue 2 years ago • 0 comments

Q A
Branch master
Bug report? yes
Feature request? no
BC Break report? no
RFC? no

Problem

The SPL class Exception accepts a \Throwable $previous exception to be passed in the constructor. Several exceptions from this bundle extend the base exception but only accept \Exception but not \Error as type for the $previous parameter.

Since in some cases also an Error can be thrown this leads to very cryptic exceptions with "wrong" directives.

Solution

Just adopt the type hint from the base Exception class to accept a Throwable.

Affected classes

scrummer avatar Aug 17 '22 12:08 scrummer