Home > OS >  Show currently active try-catch blocks in Xdebug
Show currently active try-catch blocks in Xdebug

Time:05-02

I just thought debugging nested try-catch blocks can be pretty difficult especially if they are spread around in a framework as well as in your own code.

I don't want to talk about the fact if this is actually a good software pattern or not, just the fact that it sometimes is unavoidable and therefore people have to deal with it.

So is there maybe currently a way how to debug that in Xdebug? If not - could this be a useful feature which Xdebug could maybe support?

CodePudding user response:

Probably the best that Xdebug could do is to mark a stack frame in the stack traces as an "in try...catch" block. Although you'll have to ask for that as a feature at https://bugs.xdebug.org .

If you just want to break on any exception happening, then you can set a breakpoint on the * Exception, which at least the VS Code Adapter and PhpStorm support.

  • Related