Skip to content

Commit 468953f

Browse files
authored
Merge pull request #2941 from khangah/fix-2937-unhandled-error-dart_fn_handle_output
fix #2937 unhandled error in dart_fn_handle_output when sending message
2 parents 7b40e04 + d59f05b commit 468953f

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

frb_rust/src/dart_fn/handler.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,14 @@ impl DartFnHandler {
5858
let _ = panic::catch_unwind(move || {
5959
let catch_unwind_result = panic::catch_unwind(move || {
6060
if let Some(completer) = (self.completers.lock().unwrap()).remove(&call_id) {
61-
completer.send(message).unwrap();
61+
if let Err(err) = completer.send(message) {
62+
// We do not care about details of this warning
63+
// frb-coverage:ignore-start
64+
log_warn_or_println(&format!(
65+
"Error in dart_fn_handle_output when sending message for call_id {call_id}: {err:?}"
66+
));
67+
// frb-coverage:ignore-end
68+
}
6269
}
6370
});
6471
if let Err(err) = catch_unwind_result {

0 commit comments

Comments
 (0)