Problem
In src/vs/workbench/contrib/debug/common/debugStorage.ts, five methods load debug data from storage using JSON.parse(), but all five use empty catch blocks — silently swallowing any parsing or construction errors:
loadBreakpoints() — line 83 — Stores user breakpoints
loadFunctionBreakpoints() — line 94 — Stores function breakpoints
loadExceptionBreakpoints() — line 105 — Stores exception breakpoints
loadDataBreakpoints() — line 116 — Stores data breakpoints
loadWatchExpressions() — line 127 — Stores watch expressions
If stored data gets corrupted (sync conflicts, disk errors, crash mid-write, or a bug in serialization), every single user breakpoint, function breakpoint, exception breakpoint, data breakpoint, and watch expression is silently dropped with zero indication to the user or developer. The data simply vanishes.
This class already has ILogService injected via the constructor (this.logService), but it is unused in the catch blocks.
Why this matters
Users may lose their entire debugging setup without any notification. This is especially painful for complex debug configurations with many breakpoints. The user has no way to know that their data was corrupted — they'll just see all breakpoints gone and assume they were never set.
Fix
Replace empty catch blocks with this.logService.error() calls that record the failure. This ensures:
- The error is visible in the developer console and logs
- Users/developers can diagnose why breakpoints disappeared
- The behavior is unchanged (returns empty array on failure)
- The fix is minimal, low-risk, and uses existing infrastructure
File
src/vs/workbench/contrib/debug/common/debugStorage.ts
Problem
In
src/vs/workbench/contrib/debug/common/debugStorage.ts, five methods load debug data from storage usingJSON.parse(), but all five use empty catch blocks — silently swallowing any parsing or construction errors:loadBreakpoints()— line 83 — Stores user breakpointsloadFunctionBreakpoints()— line 94 — Stores function breakpointsloadExceptionBreakpoints()— line 105 — Stores exception breakpointsloadDataBreakpoints()— line 116 — Stores data breakpointsloadWatchExpressions()— line 127 — Stores watch expressionsIf stored data gets corrupted (sync conflicts, disk errors, crash mid-write, or a bug in serialization), every single user breakpoint, function breakpoint, exception breakpoint, data breakpoint, and watch expression is silently dropped with zero indication to the user or developer. The data simply vanishes.
This class already has
ILogServiceinjected via the constructor (this.logService), but it is unused in the catch blocks.Why this matters
Users may lose their entire debugging setup without any notification. This is especially painful for complex debug configurations with many breakpoints. The user has no way to know that their data was corrupted — they'll just see all breakpoints gone and assume they were never set.
Fix
Replace empty catch blocks with
this.logService.error()calls that record the failure. This ensures:File
src/vs/workbench/contrib/debug/common/debugStorage.ts