add missing error messages (#1696)

cyan committed Sep 23, 2024 at 18:18 UTC bab45a9e36b2e017f9649fc98a7f8d7fe278c764
8 files changed +39
cw_bitcoin/lib/exceptions.dart
+15
@@ -3,6 +3,11 @@ import 'package:cw_core/exceptions.dart';
3
4 class BitcoinTransactionWrongBalanceException extends TransactionWrongBalanceException {
5 BitcoinTransactionWrongBalanceException({super.amount}) : super(CryptoCurrency.btc);
6 +
7 + @override
8 + String toString() {
9 + return "BitcoinTransactionWrongBalanceException: $amount, $currency";
10 + }
11 }
12
13 class BitcoinTransactionNoInputsException extends TransactionNoInputsException {}
@@ -13,10 +18,20 @@ class BitcoinTransactionNoDustException extends TransactionNoDustException {}
18
19 class BitcoinTransactionNoDustOnChangeException extends TransactionNoDustOnChangeException {
20 BitcoinTransactionNoDustOnChangeException(super.max, super.min);
21 +
22 + @override
23 + String toString() {
24 + return "BitcoinTransactionNoDustOnChangeException: max: $max, min: $min";
25 + }
26 }
27
28 class BitcoinTransactionCommitFailed extends TransactionCommitFailed {
29 BitcoinTransactionCommitFailed({super.errorMessage});
30 +
31 + @override
32 + String toString() {
33 + return errorMessage??"unknown error";
34 + }
35 }
36
37 class BitcoinTransactionCommitFailedDustChange extends TransactionCommitFailedDustChange {}
cw_core/lib/exceptions.dart
+5
@@ -24,6 +24,11 @@ class TransactionCommitFailed implements Exception {
24 final String? errorMessage;
25
26 TransactionCommitFailed({this.errorMessage});
27 +
28 + @override
29 + String toString() {
30 + return errorMessage??"unknown error";
31 + }
32 }
33
34 class TransactionCommitFailedDustChange implements Exception {}
cw_haven/lib/api/exceptions/setup_wallet_exception.dart
+5
@@ -2,4 +2,9 @@ class SetupWalletException implements Exception {
2 SetupWalletException({required this.message});
3
4 final String message;
5 +
6 + @override
7 + String toString() {
8 + return message;
9 + }
10 }
\ No newline at end of file
cw_monero/lib/api/exceptions/setup_wallet_exception.dart
+3
@@ -2,4 +2,7 @@ class SetupWalletException implements Exception {
2 SetupWalletException({required this.message});
3
4 final String message;
5 +
6 + @override
7 + String toString() => message;
8 }
\ No newline at end of file
cw_monero/lib/api/exceptions/wallet_restore_from_keys_exception.dart
+3
@@ -2,4 +2,7 @@ class WalletRestoreFromKeysException implements Exception {
2 WalletRestoreFromKeysException({required this.message});
3
4 final String message;
5 +
6 + @override
7 + String toString() => message;
8 }
\ No newline at end of file
cw_monero/lib/api/exceptions/wallet_restore_from_seed_exception.dart
+3
@@ -2,4 +2,7 @@ class WalletRestoreFromSeedException implements Exception {
2 WalletRestoreFromSeedException({required this.message});
3
4 final String message;
5 +
6 + @override
7 + String toString() => message;
8 }
\ No newline at end of file
cw_wownero/lib/api/exceptions/setup_wallet_exception.dart
+3
@@ -2,4 +2,7 @@ class SetupWalletException implements Exception {
2 SetupWalletException({required this.message});
3
4 final String message;
5 +
6 + @override
7 + String toString() => message;
8 }
\ No newline at end of file
cw_wownero/lib/api/exceptions/wallet_restore_from_keys_exception.dart
+2
@@ -2,4 +2,6 @@ class WalletRestoreFromKeysException implements Exception {
2 WalletRestoreFromKeysException({required this.message});
3
4 final String message;
5 +
6 + String toString() => message;
7 }
\ No newline at end of file