I've found the break-on-Swift-error to be almost useless at this point, because so many libraries routinely throw errors. You have to place a breakpoint, enable the error breakpoint, then resume.
I wish I could set a special breakpoint on a line that tells the debugger to stop if an error is thrown only inside any calls on that line.[1]
A variation of this would be a breakpoint that fires only if that line throws an error. So, not down deep where the error is first thrown, but only if that line would propagate an error out of its scope.
Within all that, filtering by type(s), if needed (e.g. “only stop if errors of types foo and bar are thrown”).
I wrote this up as FB14576727 because I was thinking in terms of Xcode, but really this is LLDB functionality, right?
As an aside, I do wish I could set breakpoints within the line, like one can in VSCode when debugging Javascript, for example. ↩︎
2 posts - 2 participants