A fork of attic a self-hostable Nix Binary Cache server
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge pull request #187 from cole-h/stream-error-better

Display anyhow error chains better

authored by

Zhaofeng Li and committed by
GitHub
2b05b7d9 e5c8d2d5

+5 -5
+2 -2
server/src/api/binary_cache.rs
··· 218 218 Download::Url(url) => Ok(Redirect::temporary(&url).into_response()), 219 219 Download::AsyncRead(stream) => { 220 220 let stream = ReaderStream::new(stream).map_err(|e| { 221 - tracing::error!("Stream error: {e}"); 221 + tracing::error!(%e, "Stream error"); 222 222 e 223 223 }); 224 224 let body = Body::from_stream(stream); ··· 255 255 // TODO: Make num_prefetch configurable 256 256 // The ideal size depends on the average chunk size 257 257 let merged = merge_chunks(chunks, streamer, storage, 2).map_err(|e| { 258 - tracing::error!("Stream error: {e}"); 258 + tracing::error!(%e, "Stream error"); 259 259 e 260 260 }); 261 261 let body = Body::from_stream(merged);
+3 -3
server/src/error.rs
··· 57 57 /// The requested NAR has missing chunks and needs to be repaired. 58 58 IncompleteNar, 59 59 60 - /// Database error: {0} 60 + /// Database error: {0:#} 61 61 DatabaseError(AnyError), 62 62 63 - /// Storage error: {0} 63 + /// Storage error: {0:#} 64 64 StorageError(AnyError), 65 65 66 66 /// Manifest serialization error: {0} ··· 69 69 /// Access error: {0} 70 70 AccessError(super::access::Error), 71 71 72 - /// General request error: {0} 72 + /// General request error: {0:#} 73 73 RequestError(AnyError), 74 74 75 75 /// Error from the common components.