Skip to content

Commit a6db2ba

Browse files
committed
ev: handle send_ev_data() errors
1 parent 0be31ec commit a6db2ba

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/ev.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,14 +64,17 @@ pub async fn rest_server(tx: Sender<Packet>, ctx: Arc<Mutex<RestContext>>) -> Re
6464
info!("{} Received battery level: {}", NAME, data.battery_level);
6565
let rest_ctx = ctx.lock().await;
6666
if let Some(ch) = rest_ctx.sensor_channel {
67-
let _ = send_ev_data(
67+
if let Err(e) = send_ev_data(
6868
tx,
6969
data.battery_level,
7070
ch,
7171
rest_ctx.ev_battery_capacity,
7272
rest_ctx.ev_factor,
7373
)
74-
.await;
74+
.await
75+
{
76+
error!("{} EV model error: {}", NAME, e);
77+
}
7578
} else {
7679
warn!("{} Not sending packet because no sensor channel yet", NAME);
7780
}

0 commit comments

Comments
 (0)