Page MenuHomePhabricator

D13593.diff
No OneTemporary

D13593.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
Mon, Nov 25, 11:17 AM (16 h, 51 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2579443
Default Alt Text
D13593.diff (1 KB)

Event Timeline