Skip to content

Commit

Permalink
fix(darwin): Fixed discovery errors causing app crashes.
Browse files Browse the repository at this point in the history
Fixed #65.
  • Loading branch information
Skyost committed Nov 27, 2023
1 parent 314df41 commit 661f1bb
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,13 @@ class BonsoirServiceDiscovery: BonsoirAction {
case .ready:
onSuccess("discoveryStarted", "Bonsoir discovery started : \(type)")
case .failed(let error):
onError("Bonsoir has encountered an error during discovery : \(error)", error)
let details: Any?
if #available(iOS 16.4, *) {
details = error.errorCode
} else {
details = error.debugDescription
}
onError("Bonsoir has encountered an error during discovery : \(error)", details)
dispose()
case .cancelled:
onSuccess("discoveryStopped", "Bonsoir discovery stopped : \(type)")
Expand Down

0 comments on commit 661f1bb

Please sign in to comment.