mirror of
https://github.com/stakwork/sphinx-key.git
synced 2025-12-18 15:54:31 +01:00
propagate errors to user in handle_control_response
This commit is contained in:
@@ -101,13 +101,14 @@ async fn main() -> Result<(), Box<dyn Error>> {
|
||||
}
|
||||
topics::CONTROL => {
|
||||
match ctrlr.handle(&msg_bytes) {
|
||||
Ok((response, _new_policy)) => {
|
||||
Ok((_msg, res)) => {
|
||||
let res_data = rmp_serde::to_vec(&res).expect("could not publish control response");
|
||||
client
|
||||
.publish(
|
||||
topics::CONTROL_RETURN,
|
||||
QoS::AtMostOnce,
|
||||
false,
|
||||
response,
|
||||
res_data,
|
||||
)
|
||||
.await
|
||||
.expect("could not mqtt publish");
|
||||
@@ -158,13 +159,14 @@ async fn main() -> Result<(), Box<dyn Error>> {
|
||||
}
|
||||
topics::CONTROL => {
|
||||
match ctrlr.handle(&msg_bytes) {
|
||||
Ok((response, _new_policy)) => {
|
||||
Ok((_msg, res)) => {
|
||||
let res_data = rmp_serde::to_vec(&res).expect("could not publish control response");
|
||||
client
|
||||
.publish(
|
||||
topics::CONTROL_RETURN,
|
||||
QoS::AtMostOnce,
|
||||
false,
|
||||
response,
|
||||
res_data,
|
||||
)
|
||||
.await
|
||||
.expect("could not mqtt publish");
|
||||
|
||||
Reference in New Issue
Block a user