ZIm/crates/collab_ui/src
Kirill Bulatov 16366cf9f2
Use anyhow more idiomatically (#31052)
https://github.com/zed-industries/zed/issues/30972 brought up another
case where our context is not enough to track the actual source of the
issue: we get a general top-level error without inner error.

The reason for this was `.ok_or_else(|| anyhow!("failed to read HEAD
SHA"))?; ` on the top level.

The PR finally reworks the way we use anyhow to reduce such issues (or
at least make it simpler to bubble them up later in a fix).
On top of that, uses a few more anyhow methods for better readability.

* `.ok_or_else(|| anyhow!("..."))`, `map_err` and other similar error
conversion/option reporting cases are replaced with `context` and
`with_context` calls
* in addition to that, various `anyhow!("failed to do ...")` are
stripped with `.context("Doing ...")` messages instead to remove the
parasitic `failed to` text
* `anyhow::ensure!` is used instead of `if ... { return Err(...); }`
calls
* `anyhow::bail!` is used instead of `return Err(anyhow!(...));`

Release Notes:

- N/A
2025-05-20 23:06:07 +00:00
..
chat_panel Rename regex search tool to grep and accept an include glob pattern (#29100) 2025-04-20 00:53:30 +00:00
collab_panel chore: Bump Rust edition to 2024 (#27800) 2025-03-31 20:55:27 +02:00
notifications gpui: Add a standard text example (#30747) 2025-05-16 17:35:44 +02:00
channel_view.rs Add the ability to follow the agent as it makes edits (#29839) 2025-05-04 08:28:39 +00:00
chat_panel.rs Reduce allocations (#30693) 2025-05-14 18:29:28 +02:00
collab_panel.rs Use anyhow more idiomatically (#31052) 2025-05-20 23:06:07 +00:00
collab_ui.rs chore: Bump Rust edition to 2024 (#27800) 2025-03-31 20:55:27 +02:00
notification_panel.rs Separate timeout and connection dropped errors out (#30457) 2025-05-10 15:12:58 +03:00
notifications.rs Eliminate GPUI View, ViewContext, and WindowContext types (#22632) 2025-01-26 03:02:45 +00:00
panel_settings.rs Deny unknown keys in settings in JSON schema so user gets warnings but settings still parses (#30583) 2025-05-12 17:48:36 -04:00