Skip to content

Commit

Permalink
Merge pull request #1251 from weese/fix/broken-error-handling
Browse files Browse the repository at this point in the history
[FIX] errors were ignored due to broken serialization in read()
  • Loading branch information
marcosinigaglia authored Aug 27, 2024
2 parents 3717ed9 + 91546a7 commit 4dc5995
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ios/BleManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1025,7 +1025,7 @@ class BleManager: RCTEventEmitter, CBCentralManagerDelegate, CBPeripheralDelegat

if let error = error {
NSLog("Error reading descriptor value for \(descriptor.uuid) on characteristic \(descriptor.characteristic!.uuid) :\(error)")
invokeAndClearDictionary(&readDescriptorCallbacks, withKey: key, usingParameters: [error, NSNull()])
invokeAndClearDictionary(&readDescriptorCallbacks, withKey: key, usingParameters: [error.localizedDescription, NSNull()])
return
}

Expand Down Expand Up @@ -1073,7 +1073,7 @@ class BleManager: RCTEventEmitter, CBCentralManagerDelegate, CBPeripheralDelegat

if let error = error {
NSLog("Error \(characteristic.uuid) :\(error)")
invokeAndClearDictionary(&readCallbacks, withKey: key, usingParameters: [error, NSNull()])
invokeAndClearDictionary(&readCallbacks, withKey: key, usingParameters: [error.localizedDescription, NSNull()])
return
}

Expand Down

0 comments on commit 4dc5995

Please sign in to comment.