Conversation
ehayes2000
commented
Dec 12, 2025
- fetch folders
- folder attachments
- Read project tool
whutchinson98
left a comment
There was a problem hiding this comment.
due to using tracing json for datadog we actually lose the underlying error message when context is provided. Sometimes this is fine but most of the time we should actually have tracing instrument log the error for us and we don't want to lose the useful underlying error.
also, please prefer using tracing over eprintln and println as tracing is our standard as its configurable
|
|
||
| serde_json::from_value(json) | ||
| .inspect_err(|err| eprintln!("jsonfail {:#?}", err)) | ||
| .context("unexpected response") |
| .context("failed to fetch json")?; | ||
|
|
||
| serde_json::from_value(json) | ||
| .inspect_err(|err| eprintln!("jsonfail {:#?}", err)) |
There was a problem hiding this comment.
instead of inspect, just have tracing instrument err so it's automatically logged
make sure whatever is using document_storage_client has log level set to error
| .context("failed to fetch head")? | ||
| .json() | ||
| .await | ||
| .context("failed to fetch json")?; |
| .external_request(reqwest::Method::GET, path.as_str(), jwt) | ||
| .send() | ||
| .await | ||
| .context("failed to fetch head")? |
| .fetch_project(attachment.attachment_id.clone(), jwt.to_owned()) | ||
| .content() | ||
| .await | ||
| .context("failed to fetch project")? |
| use super::DocumentStorageServiceClient; | ||
|
|
||
| impl DocumentStorageServiceClient { | ||
| #[tracing::instrument(skip(self))] |
There was a problem hiding this comment.
can you please add err here to the instrument
the |
|