add missing error messages (#1696)

This commit is contained in:
cyan 2024-09-23 18:18:21 +02:00 committed by GitHub
parent 17de9f16b8
commit bab45a9e36
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 39 additions and 0 deletions

View file

@ -3,6 +3,11 @@ import 'package:cw_core/exceptions.dart';
class BitcoinTransactionWrongBalanceException extends TransactionWrongBalanceException {
BitcoinTransactionWrongBalanceException({super.amount}) : super(CryptoCurrency.btc);
@override
String toString() {
return "BitcoinTransactionWrongBalanceException: $amount, $currency";
}
}
class BitcoinTransactionNoInputsException extends TransactionNoInputsException {}
@ -13,10 +18,20 @@ class BitcoinTransactionNoDustException extends TransactionNoDustException {}
class BitcoinTransactionNoDustOnChangeException extends TransactionNoDustOnChangeException {
BitcoinTransactionNoDustOnChangeException(super.max, super.min);
@override
String toString() {
return "BitcoinTransactionNoDustOnChangeException: max: $max, min: $min";
}
}
class BitcoinTransactionCommitFailed extends TransactionCommitFailed {
BitcoinTransactionCommitFailed({super.errorMessage});
@override
String toString() {
return errorMessage??"unknown error";
}
}
class BitcoinTransactionCommitFailedDustChange extends TransactionCommitFailedDustChange {}

View file

@ -24,6 +24,11 @@ class TransactionCommitFailed implements Exception {
final String? errorMessage;
TransactionCommitFailed({this.errorMessage});
@override
String toString() {
return errorMessage??"unknown error";
}
}
class TransactionCommitFailedDustChange implements Exception {}

View file

@ -2,4 +2,9 @@ class SetupWalletException implements Exception {
SetupWalletException({required this.message});
final String message;
@override
String toString() {
return message;
}
}

View file

@ -2,4 +2,7 @@ class SetupWalletException implements Exception {
SetupWalletException({required this.message});
final String message;
@override
String toString() => message;
}

View file

@ -2,4 +2,7 @@ class WalletRestoreFromKeysException implements Exception {
WalletRestoreFromKeysException({required this.message});
final String message;
@override
String toString() => message;
}

View file

@ -2,4 +2,7 @@ class WalletRestoreFromSeedException implements Exception {
WalletRestoreFromSeedException({required this.message});
final String message;
@override
String toString() => message;
}

View file

@ -2,4 +2,7 @@ class SetupWalletException implements Exception {
SetupWalletException({required this.message});
final String message;
@override
String toString() => message;
}

View file

@ -2,4 +2,6 @@ class WalletRestoreFromKeysException implements Exception {
WalletRestoreFromKeysException({required this.message});
final String message;
String toString() => message;
}