Skip to content

Commit

Permalink
fix: make DiscoveryException actually usable
Browse files Browse the repository at this point in the history
  • Loading branch information
JKRhb committed May 30, 2022
1 parent aa4c90b commit 2b7d029
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions lib/src/core/thing_discovery.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,17 @@ import '../definitions/thing_description.dart';
import 'servient.dart';

/// Custom [Exception] that is thrown when the discovery process fails.
class DiscoveryError implements Exception {
class DiscoveryException implements Exception {
/// The error message of this exception.
final String message;

/// Creates a new [DiscoveryError] with the specified error [message].
DiscoveryError(this.message);
/// Creates a new [DiscoveryException] with the specified error [message].
DiscoveryException(this.message);

@override
String toString() {
return "$runtimeType: $message";
}
}

/// Implemention of the [scripting_api.ThingDiscovery] interface.
Expand Down

0 comments on commit 2b7d029

Please sign in to comment.