fix some anyhow::Context::context calls that should use with_context(format!(...))

Noticed this while combing through some production logs.
This commit is contained in:
Christian Schwarz
2023-01-24 10:54:33 +01:00
committed by Christian Schwarz
parent fd18692dfb
commit 55c184fcd7
3 changed files with 3 additions and 3 deletions

View File

@@ -282,7 +282,7 @@ async fn timeline_detail_handler(request: Request<Body>) -> Result<Response<Body
let timeline_info = build_timeline_info(&timeline, include_non_incremental_logical_size)
.await
.context("Failed to get local timeline info: {e:#}")
.context("get local timeline info")
.map_err(ApiError::InternalServerError)?;
Ok::<_, ApiError>(timeline_info)

View File

@@ -488,7 +488,7 @@ impl Timeline {
let mut buf = self
.get(relsize_key, lsn)
.await
.context("read relation size of {rel:?}")?;
.with_context(|| format!("read relation size of {rel:?}"))?;
let relsize = buf.get_u32_le();
total_size += relsize as u64;

View File

@@ -2285,7 +2285,7 @@ impl Timeline {
let metadata = timeline_path
.join(path.file_name())
.metadata()
.context("reading metadata of layer file {path}")?;
.with_context(|| format!("reading metadata of layer file {}", path.file_name()))?;
layer_paths_to_upload.insert(path, LayerFileMetadata::new(metadata.len()));