Page MenuHomePhabricator

D13593.id44871.diff
No OneTemporary

D13593.id44871.diff

diff --git a/services/tunnelbroker/src/amqp.rs b/services/tunnelbroker/src/amqp.rs
--- a/services/tunnelbroker/src/amqp.rs
+++ b/services/tunnelbroker/src/amqp.rs
@@ -1,3 +1,4 @@
+use crate::constants::error_types;
use crate::CONFIG;
use lapin::{uri::AMQPUri, Connection, ConnectionProperties};
use tracing::info;
@@ -23,6 +24,12 @@
let conn = Connection::connect_uri(amqp_uri, options)
.await
.expect("Unable to connect to AMQP endpoint");
+ conn.on_error(|error| {
+ tracing::error!(
+ errorType = error_types::AMQP_ERROR,
+ "Lapin error: {error:?}"
+ );
+ });
info!("Connected to AMQP endpoint: {}", &CONFIG.amqp_uri);
conn
diff --git a/services/tunnelbroker/src/websockets/session.rs b/services/tunnelbroker/src/websockets/session.rs
--- a/services/tunnelbroker/src/websockets/session.rs
+++ b/services/tunnelbroker/src/websockets/session.rs
@@ -684,7 +684,7 @@
pub async fn send_message_to_device(&mut self, message: Message) {
if let Err(e) = self.tx.send(message).await {
error!(
- errorType = error_types::AMQP_ERROR,
+ errorType = error_types::WEBSOCKET_ERROR,
"Failed to send message to device: {}", e
);
}

File Metadata

Mime Type
text/plain
Expires
Fri, Nov 22, 10:32 PM (17 h, 23 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2565972
Default Alt Text
D13593.id44871.diff (1 KB)

Event Timeline