JavaScript is disabled, refresh for a better experience. ambee/giterated

ambee/giterated

Git repository hosting, collaboration, and discovery for the Fediverse.

Add logging for internal errors

Amber - ⁨2⁩ years ago

parent: tbd commit: ⁨d0fc0ed

Showing ⁨⁨1⁩ changed file⁩ with ⁨⁨5⁩ insertions⁩ and ⁨⁨0⁩ deletions⁩

giterated-daemon/src/connection/wrapper.rs

View file
@@ -9,6 +9,7 @@ use futures_util::{SinkExt, StreamExt};
9 9
10 10 use giterated_models::{
11 11 authenticated::{AuthenticationSource, UserTokenMetadata},
12 error::OperationError,
12 13 instance::Instance,
13 14 };
14 15
@@ -168,6 +169,10 @@ pub async fn connection_wrapper(
168 169 operation_state.user = None;
169 170 operation_state.instance = None;
170 171
172 if let Err(OperationError::Internal(internal_error)) = &result {
173 error!("An internal error has occured: {}", internal_error);
174 }
175
171 176 let mut socket = connection_state.socket.lock().await;
172 177 let _ = socket
173 178 .send(Message::Binary(bincode::serialize(&result).unwrap()))