Skip to content

Commit

Permalink
x
Browse files Browse the repository at this point in the history
  • Loading branch information
lhoward committed Nov 24, 2024
1 parent 70decd9 commit a872128
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Sources/FlutterSwift/Channel/FlutterEventChannel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,16 @@ public final class FlutterEventChannel: _FlutterBinaryMessengerConnectionReprese
}
try await binaryMessenger.send(on: name, message: nil)
} catch let error as FlutterError {
debugPrint("*** got flutter error \(error)")
let envelope = FlutterEnvelope<Event>.failure(error)
try await binaryMessenger.send(on: name, message: codec.encode(envelope))
debugPrint("*** handled flutter error \(error)")
} catch is CancellationError {
debugPrint("*** got cancellation error")
try await binaryMessenger.send(on: name, message: nil)
debugPrint("*** handled cancellation error")
} catch {
debugPrint("*** got invalid event error")
throw FlutterSwiftError.invalidEventError
}
}
Expand Down Expand Up @@ -172,6 +177,7 @@ public final class FlutterEventChannel: _FlutterBinaryMessengerConnectionReprese
self._removeTask(id)
throw error
}
debugPrint("*** task finished of its own accord")
}
_addTask(id, task)
envelope = FlutterEnvelope.success(nil)
Expand Down

0 comments on commit a872128

Please sign in to comment.