Skip to content

Commit

Permalink
fix: fix error handling within ThingDiscovery class
Browse files Browse the repository at this point in the history
  • Loading branch information
JKRhb committed Dec 6, 2024
1 parent 26921a7 commit 49c754f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/src/core/implementation/thing_discovery.dart
Original file line number Diff line number Diff line change
Expand Up @@ -485,11 +485,11 @@ class ThingDiscoveryProcess extends Stream<ThingDescription>
}) {
final streamSubscription = _thingDescriptionStream.listen(
onData,
onError: (error, stackTrace) {
onError: (error) {
if (error is Exception) {
_error = error;
// ignore: avoid_dynamic_calls
onError?.call(error, stackTrace);
onError?.call(error);
}
},
onDone: () {
Expand Down
2 changes: 1 addition & 1 deletion test/core/discovery_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ void main() {
(event) {
counter++;
},
onError: (error, stackTrace) async {},
onError: (error) async {},
onDone: () {
expect(counter, 0);
expect(thingDiscoveryProcess.done, true);
Expand Down

0 comments on commit 49c754f

Please sign in to comment.