vscode-php-debug icon indicating copy to clipboard operation
vscode-php-debug copied to clipboard

Add ability to ignore certain exceptions

Open ghost opened this issue 8 years ago • 6 comments
trafficstars

Not a "bug", but it would be nice if we had the ability to ignore specific exceptions. When using Visual Studio we had the ability to do this via comment flags that would tell the editor to not stop on that error. It would be nice if there was some way to implement that in VS Code.

ghost avatar Aug 02 '17 13:08 ghost

+1

maruf89 avatar Dec 20 '20 12:12 maruf89

+1

sbecker11 avatar May 19 '21 20:05 sbecker11

Awesome idea, I would pay for someone to implement this.

For now, the best way I could find is to ignore the file that generates the Exception I want to ignore in launch.json:

  "configurations": [
    {
      "name": "php docker (9001)",
      "type": "php",
      "request": "launch",
      "port": 9001,
      "log": false,
      "stopOnEntry": false,
      "pathMappings": {
        "/sites/": "${workspaceRoot}/sites/",
        "/sites/api/html/": "${workspaceRoot}/",
        "/sites/logs/html/": "${workspaceRoot}/"
      },
      "ignore": [
        "**/Encryption/Encrypter.php",
      ]
    },

8ctopus avatar Jan 17 '23 07:01 8ctopus

Hi. I really want to do this as I feel it's a key component of any decent debugger.

I think there is still no native UI support for this in VS Code. We could "abuse" the currently available function breakpoints interface, but that would probably not be that user friendly.

An "all out" solution would extend the UI and somehow hook into the display of exceptions to add a menu "ignore this exception".

Also if we want to provide a list of known exceptions, we'd need to integrate with a language service extension...

Let me know if you feel something like this could be useful, that should be easy enough to implement:

image

zobo avatar Jan 17 '23 09:01 zobo

+1

ailxsey avatar Jun 12 '23 19:06 ailxsey

For anyone else discovering this issue, this feature has been supported with ignoreExceptions setting since v1.32.0

mcdamo avatar Apr 09 '24 01:04 mcdamo