[Drupal 8] Don't you just love those cryptic error messages when you misconfigure something?

I personally hate them, hate them enough that I’ve started working on a solution. I’m going to be submitting it tomorrow, but this is what the error messages will look like.

http://www.screencast.com/t/LwBdXAIq5P

This is done with one class and PHP’s assertion mechanism. The Assert registry sets up an assertion handler, then when one occurs it translates an encoded string with the assert statement into the full form one seen in the screen shot. The assert line that set that off was this.

assert($this->linkGenerator instanceof LinkGeneratorInterface, 'Core.Template.TwigExtension.getLink.noLinkGenerator');

The registrar then traverses the module.assertions.yml files and finds all entries linked to that string and puts them together to put out a far more helpful debug message than we currently get.

I’m going to try to get it into Drupal 8 since its actually a very small feature (1 90 line file). The yml files and strategic placing of the assert statements however will take time.

I assume that you’re simply infomrming of the issue…

No, I’m submitting a working patch file. It was very easy to write this despite how useful a tool it will be.

1 Like

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.