Gam
Gam

Reputation: 1272

XDebug halts execution on caught-exceptions

I'm using VSCode + PHP Debug extension, and when I debug my application, the script execution is halted on any exception, even if it has been caught.

enter image description here

Extension: https://marketplace.visualstudio.com/items?itemName=felixfbecker.php-debug

{
    "version": "0.2.0",
    "configurations": [

        {
            "name": "Listen for XDebug",
            "type": "php",
            "request": "launch",
            "port": 9000
        },
        {
            "name": "Launch currently open script",
            "type": "php",
            "request": "launch",
            "program": "${file}",
            "cwd": "${fileDirname}",
            "port": 9000
        }
    ]
}

XDebug settings

xdebug.remote_autostart=1
xdebug.remote_enable=1
xdebug.show_exception_trace=0

Upvotes: 3

Views: 256

Answers (1)

Sahan Serasinghe
Sahan Serasinghe

Reputation: 1651

I also had the same issue Xdebug being stopped at pretty much everything it goes through.

If you go to the Debug panel of VS Code and at the bottom check for the Breakpoints section. Disable Notices, Exceptions, Everything and Warnings (or whatever suits you best).

I basically keep the aforementioned 4 settings unticked so that it will only stop at my breakpoints.

Screenshot of the settings: Imgur (Unfortunately, SO's image uploading plugin doesn't seem to work for me!)

Hope this helps :)

Upvotes: 2

Related Questions