Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3486730
D10996.id37365.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D10996.id37365.diff
View Options
diff --git a/services/identity/src/websockets/mod.rs b/services/identity/src/websockets/mod.rs
--- a/services/identity/src/websockets/mod.rs
+++ b/services/identity/src/websockets/mod.rs
@@ -25,7 +25,7 @@
use crate::constants::{
IDENTITY_SERVICE_WEBSOCKET_ADDR, SOCKET_HEARTBEAT_TIMEOUT,
};
-use send::{send_error_response, send_message, WebsocketSink};
+use send::{send_message, WebsocketSink};
pub mod errors;
#[derive(Serialize, Deserialize)]
@@ -298,7 +298,7 @@
ping_timeout = Box::pin(tokio::time::sleep(SOCKET_HEARTBEAT_TIMEOUT));
if let Err(e) = handle_websocket_frame(text, outgoing.clone()).await {
- send_error_response(e, outgoing.clone()).await;
+ error!("Error handling WebSocket frame: {}", e);
continue;
};
}
diff --git a/services/identity/src/websockets/send.rs b/services/identity/src/websockets/send.rs
--- a/services/identity/src/websockets/send.rs
+++ b/services/identity/src/websockets/send.rs
@@ -8,33 +8,9 @@
use hyper_tungstenite::WebSocketStream;
use tracing::error;
-use crate::websockets::errors;
-
pub type WebsocketSink =
Arc<Mutex<SplitSink<WebSocketStream<Upgraded>, Message>>>;
-pub async fn send_error_response(
- error: errors::WebsocketError,
- outgoing: WebsocketSink,
-) {
- let response_msg = serde_json::json!({
- "action": "errorMessage",
- "error": format!("{}", error)
- });
-
- match serde_json::to_string(&response_msg) {
- Ok(serialized_response) => {
- send_message(Message::Text(serialized_response), outgoing).await;
- }
- Err(serialize_error) => {
- error!(
- "Failed to serialize the error response: {:?}",
- serialize_error
- );
- }
- }
-}
-
pub async fn send_message(message: Message, outgoing: WebsocketSink) {
if let Err(e) = outgoing.lock().await.send(message).await {
error!("Failed to send message to device: {}", e);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Dec 19, 5:48 AM (20 h, 27 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2675120
Default Alt Text
D10996.id37365.diff (1 KB)
Attached To
Mode
D10996: [identity] Remove usage of sending raw error messages to client
Attached
Detach File
Event Timeline
Log In to Comment