                 }
                 // cancel old task
                 if let oldTask = self.continuation.discoverCharacteristics[peripheral] {
-                    oldTask.finish(throwing: CancellationError())
+                    oldTask.resume(throwing: CancellationError())
                     self.continuation.discoverCharacteristics[peripheral] = nil
                 }
                 // notify

                return
            }
            if let error = error {
                continuation.finish(throwing: error)
            } else {
                for characteristicObject in (serviceObject.characteristics ?? []) {
                    let characteristic = Characteristic(
                        characteristic: characteristicObject,
                        peripheral: peripheralObject
                    )
                    continuation.yield(characteristic)
                }
                continuation.finish(throwing: nil)
            }
            // remove callback
            self.central.continuation.discoverCharacteristics[peripheral] = nil

                return
            }
            if let error = error {
                continuation.resume(throwing: error)
            } else {
                let descriptors = (characteristicObject.descriptors ?? []).map { descriptorObject in
                    Descriptor(
                        descriptor: descriptorObject,
                        peripheral: peripheralObject
                    )
                }
                continuation.resume(returning: descriptors)
            }
            // remove callback
            self.central.continuation.discoverDescriptors[peripheral] = nil
