mirror of
https://github.com/zed-industries/zed.git
synced 2024-12-28 21:03:51 +03:00
1c2859d72b
One of the complaints of users on our first Hack call was that the error messages you got when channel joining failed were not great. This aims to fix that specific case, and lay the groundwork for future improvements. It adds two new methods to anyhow::Error * `.error_code()` which returns a value from zed.proto (or ErrorCode::Internal if the error has no specific tag) * `.error_tag("key")` which returns the value of the tag (or None). To construct errors with these fields set, you can use a builder API based on the ErrorCode type: * `Err(ErrorCode::Forbidden.anyhow())` * `Err(ErrorCode::Forbidden.message("cannot join channel").into())` - to add any context you want in the logs * `Err(ErrorCode::WrongReleaseChannel.tag("required", "stable").into())` - to add structured metadata to help the client handle the error better. Release Notes: - Improved error messaging when channel joining fails. |
||
---|---|---|
.. | ||
src | ||
Cargo.toml | ||
LICENSE-GPL |