Skip to content

Commit ac2627f

Browse files
committed
handled feeRateEstimation exception
1 parent 60a6133 commit ac2627f

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

lib/src/root.dart

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,13 @@ import 'generated/api/node.dart';
1111
class Mnemonic extends LdkMnemonic {
1212
Mnemonic({required super.seedPhrase});
1313
static Future<Mnemonic> generate() async {
14-
await Frb.verifyInit();
15-
final res = await LdkMnemonic.generate();
16-
return Mnemonic(seedPhrase: res.seedPhrase);
14+
try {
15+
await Frb.verifyInit();
16+
final res = await LdkMnemonic.generate();
17+
return Mnemonic(seedPhrase: res.seedPhrase);
18+
} on error.NodeException catch (e) {
19+
throw mapNodeException(e);
20+
}
1721
}
1822
}
1923

@@ -627,6 +631,8 @@ class Builder {
627631
return Node._(ptr: res.ptr);
628632
} on error.BuilderException catch (e) {
629633
throw mapBuilderException(e);
634+
} on error.NodeException catch (e) {
635+
throw mapNodeException(e);
630636
}
631637
}
632638
}

0 commit comments

Comments
 (0)