Search code examples
iosswiftdebuggingcombine

Using breakpointOnError() in Combine


There are several methods within Combine like...

  • breakpointOnError()
  • breakpoint(receiveSubscription:receiveOutput:receiveCompletion:)

What happens if you forget to remove these and it goes into a release build? Does the compiler pass them over because there's a release flag on the build or do I risk an exception?


Solution

  • SIGTRAP, produced by breakpointOnError, crashes the process when not attached to a debugger. So the app will crash whenever the debugger is not attached - both in debug and production builds.

    I have filed a feedback #FB9626473.