From d055407ffaac87ae1062e5926a62669deac823e6 Mon Sep 17 00:00:00 2001 From: "vladimir.koltunov" Date: Tue, 28 Jan 2025 07:38:14 +0300 Subject: [PATCH] more generic implementation --- pkgs/async/lib/src/subscription_stream.dart | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/pkgs/async/lib/src/subscription_stream.dart b/pkgs/async/lib/src/subscription_stream.dart index af3cb94d..96a7a2b1 100644 --- a/pkgs/async/lib/src/subscription_stream.dart +++ b/pkgs/async/lib/src/subscription_stream.dart @@ -76,13 +76,9 @@ class _CancelOnErrorSubscriptionWrapper super.onError((Object error, StackTrace stackTrace) { // Wait for the cancel to complete before sending the error event. super.cancel().whenComplete(() { - if (handleError is ZoneBinaryCallback) { + if (handleError is dynamic Function(Object, StackTrace)) { handleError(error, stackTrace); - } else if (handleError is ZoneBinaryCallback) { - handleError(error, stackTrace); - } else if (handleError is ZoneUnaryCallback) { - handleError(error); - } else if (handleError is ZoneUnaryCallback) { + } else if (handleError is dynamic Function(Object)) { handleError(error); } });