44//
55// SPDX-License-Identifier: BSD-3-Clause
66
7+ import "package:meta/meta.dart" ;
8+
79export "exceptions/web_idl.dart" ;
810
911/// Base class for custom exceptions defined in `dart_wot` .
12+ @immutable
1013base class DartWotException implements Exception {
1114 /// Constructor.
12- DartWotException (this .message);
15+ const DartWotException (this .message);
1316
1417 /// The error message of this [ValidationException] .
1518 final String message;
1619
1720 /// The name of this [Exception] that will appear in the error message log.
18- final exceptionType = "DartWotException" ;
21+ String get exceptionType => "DartWotException" ;
1922
2023 @override
2124 String toString () => "$exceptionType : $message " ;
@@ -24,7 +27,7 @@ base class DartWotException implements Exception {
2427/// An [Exception] that is thrown when the validation of a definition fails.
2528base class ValidationException extends DartWotException {
2629 /// Constructor.
27- ValidationException (super .message, [this ._validationErrors]);
30+ const ValidationException (super .message, [this ._validationErrors]);
2831
2932 final List <Object >? _validationErrors;
3033
@@ -52,7 +55,7 @@ base class ValidationException extends DartWotException {
5255/// Custom [Exception] that is thrown when the discovery process fails.
5356final class DiscoveryException extends DartWotException {
5457 /// Creates a new [DiscoveryException] with the specified error [message] .
55- DiscoveryException (super .message);
58+ const DiscoveryException (super .message);
5659
5760 @override
5861 String get exceptionType => "DiscoveryException" ;
0 commit comments