Skip to content

Commit

Permalink
Add a feature flag for userUnhandled exception filter.
Browse files Browse the repository at this point in the history
  • Loading branch information
int19h committed Sep 30, 2020
1 parent 3d472df commit 49919cd
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions src/debugpy/adapter/clients.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,19 @@ def initialize_request(self, request):
self.expectations = self.Expectations(self, request)
self._initialize_request = request

exception_breakpoint_filters = [
{"filter": "raised", "label": "Raised Exceptions", "default": False},
{"filter": "uncaught", "label": "Uncaught Exceptions", "default": True},
]
if int(os.getenv("DEBUGPY_EXCEPTION_FILTER_USER_UNHANDLED", "0")) != 0:
exception_breakpoint_filters += [
{
"filter": "userUnhandled",
"label": "User Uncaught Exceptions",
"default": True,
},
]

return {
"supportsCompletionsRequest": True,
"supportsConditionalBreakpoints": True,
Expand All @@ -159,11 +172,7 @@ def initialize_request(self, request):
"supportsValueFormattingOptions": True,
"supportsTerminateDebuggee": True,
"supportsGotoTargetsRequest": True,
"exceptionBreakpointFilters": [
{"filter": "raised", "label": "Raised Exceptions", "default": False},
{"filter": "uncaught", "label": "Uncaught Exceptions", "default": True},
{"filter": "userUnhandled", "label": "User Uncaught Exceptions", "default": False},
],
"exceptionBreakpointFilters": exception_breakpoint_filters,
}

# Common code for "launch" and "attach" request handlers.
Expand Down

0 comments on commit 49919cd

Please sign in to comment.