Break on handled exceptions

Answered

Can you break on handled exceptions? I mean when you're working on code with full error handling, you want the code to break at the error point rather than get bubbled up to the error handler.

0
7 comments

with that you have to create a breakpoint which means you know the line in the code you think is causing the exception

Actually, no. Exception breakpoints are not bound to any line. Please check the blog post:

https://blog.jetbrains.com/phpstorm/2013/12/just-in-time-debugging-and-php-exception-breakpoints-with-phpstorm-and-xdebug/

2
Avatar
Permanently deleted user

Hi,

Looks like you need exception breakpoints: https://www.jetbrains.com/help/phpstorm/creating-exception-breakpoints.html .

1

I mean like this in Visual Studio:

https://stackoverflow.com/questions/116896/visual-studio-how-to-break-on-handled-exceptions

 

Or is it a limitation of xdebug? 

0

Thanks for that. I'm not sure if that's quite what I'm looking for because with that you have to create a breakpoint which means you know the line in the code you think is causing the exception, I'm talking about stepping over (not into)  mounds of procedures then suddenly an exception occurs in a mystery nested spot and you get kicked up to the error handler without being able to examine the value of all the variables.

0

Thanks. I think that might be it.....

0
Avatar
Permanently deleted user

I can setup a project with php exceptions in a regular php website but I cannot do it inside a Drupal 9 project? 

Does anybody know why / How to prevent Drupal from triggering those exceptions to phpstorm?

0

Could you please provide an example of a workflow you're having in mind?

0

Please sign in to leave a comment.