Skip to content

Commit ce7d79b

Browse files
committed
cln-plugin: don't panic if notification handler returns error
Changelog-None
1 parent 63e15c1 commit ce7d79b

File tree

2 files changed

+20
-3
lines changed

2 files changed

+20
-3
lines changed

external/libwally-core

Submodule libwally-core updated 101 files

plugins/src/lib.rs

+19-2
Original file line numberDiff line numberDiff line change
@@ -813,7 +813,17 @@ where
813813
match &self.wildcard_subscription {
814814
Some(cb) => {
815815
let call = cb(plugin.clone(), params.clone());
816-
tokio::spawn(async move { call.await.unwrap() });
816+
tokio::spawn(async move {
817+
match call.await {
818+
Ok(_o) => (),
819+
Err(e) => {
820+
log::warn!(
821+
"Wildcard notification handler error: '{}'",
822+
e
823+
)
824+
}
825+
}
826+
});
817827
}
818828
None => {}
819829
};
@@ -823,7 +833,14 @@ where
823833
match self.subscriptions.get(method) {
824834
Some(cb) => {
825835
let call = cb(plugin.clone(), params.clone());
826-
tokio::spawn(async move { call.await.unwrap() });
836+
tokio::spawn(async move {
837+
match call.await {
838+
Ok(_o) => (),
839+
Err(e) => {
840+
log::warn!("Notification handler error: '{}'", e)
841+
}
842+
}
843+
});
827844
}
828845
None => {
829846
if self.wildcard_subscription.is_none() {

0 commit comments

Comments
 (0)