fluid-components icon indicating copy to clipboard operation
fluid-components copied to clipboard

Add component backtrace on invalid argument exception

Open sascha-egerer opened this issue 2 years ago • 2 comments

If an invalid argument is passed to a component an exception is thrown:

The argument "image" defined in "Foo\Bar\FluidComponents\Component\Image" has declared type "SMS\FluidComponents\Domain\Model\Image", but "NULL" was give

Sometimes it's really hard to figure out where the error occurs. It would be very helpful to have a component stack backtrace in the exception. The argument "image" defined in "Foo\Bar\FluidComponents\Component\Image" has declared type "SMS\FluidComponents\Domain\Model\Image", but "NULL" was give in Foo\Bar\FluidComponents\Module\Layout\Page\Default -> Foo\Bar\FluidComponents\Module\Footer -> Foo\Bar\FluidComponents\Module\LogoBox -> Foo\Bar\FluidComponents\Component\Link -> Foo\Bar\FluidComponents\Component\Image

sascha-egerer avatar May 02 '23 20:05 sascha-egerer

Good idea! This could be based on #144 which introduces a data structure for component metadata.

s2b avatar Jun 08 '23 09:06 s2b

Yeah I have a patch ready based on a previous patch of named slots. I can push it one rebased on master

sascha-egerer avatar Jun 08 '23 12:06 sascha-egerer