Skip to content

Commit

Permalink
fix: Added missing Thunder Error code propagation to EndPoint Broker. (
Browse files Browse the repository at this point in the history
  • Loading branch information
Vinodsathyaseelan authored Oct 31, 2024
1 parent b897614 commit 03e4332
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions core/main/src/broker/thunder/thunder_plugins_status_mgr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,8 @@ impl StatusManager {
}
}
} else if let Some(_e) = &data.error {
Self::on_thunder_error_response(self, callback, data, &callsign.to_string()).await;
self.on_thunder_error_response(callback, data, &callsign.to_string())
.await;
}
}

Expand All @@ -386,20 +387,25 @@ impl StatusManager {
data: &JsonRpcApiResponse,
request: &str,
) {
let result = match &data.result {
Some(result) => result,
None => return,
};

let callsign = match request.split('@').last() {
Some(callsign) => callsign.trim_matches(|c| c == '"' || c == '}'),
None => return,
None => "",
};

let result = match &data.result {
Some(result) => result,
None => {
self.on_thunder_error_response(callback, data, &callsign.to_string())
.await;
return;
}
};

let status_res: Vec<Status> = match serde_json::from_value(result.clone()) {
Ok(status_res) => status_res,
Err(_) => {
Self::on_thunder_error_response(self, callback, data, &callsign.to_string()).await;
self.on_thunder_error_response(callback, data, &callsign.to_string())
.await;
return;
}
};
Expand Down

0 comments on commit 03e4332

Please sign in to comment.