How to prevent PhpStorm from breaking on ReflectionExceptions?

Viewed 72

The following adding the conditions have not worked so far:

  • !(Exception instanceof ReflectionException)
  • !(Exception instanceof \ReflectionException)
  • !(this instanceof ReflectionException)
  • !(this instanceof \ReflectionException)
  • !anInstanceOf(ReflectionException)
  • !anInstanceOf(\ReflectionException)

It still always breaks when a ReflectionException is thrown.

PhpStorm Documentation

enter image description here

1 Answers

There is no way, unfortunately.

A breakpoint condition is being sent to Xdebug within an eval command, so it has to be something that can actually be evaluated.

The Exception node in the PhpStorm's Variables pane, on the other hand, is received from Xdebug upon a break event once and can not be requested/evaluated further, so you can't put it into the condition.

So, it's either PhpStorm that should have an extra field in Exception Breakpoints that would check the Exception node contents, or Xdebug should have it possible to evaluate the exception somehow.

I'd say it's worth filing a feature request to us: https://youtrack.jetbrains.com/newIssue?project=WI

Related