collab errors (#4152)
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.
This commit is contained in:
commit
1c2859d72b
23 changed files with 446 additions and 101 deletions
|
@ -31,7 +31,8 @@ pub fn init(cx: &mut AppContext) {
|
|||
|
||||
let prompt = cx.prompt(
|
||||
PromptLevel::Info,
|
||||
&format!("Copied into clipboard:\n\n{specs}"),
|
||||
"Copied into clipboard",
|
||||
Some(&specs),
|
||||
&["OK"],
|
||||
);
|
||||
cx.spawn(|_, _cx| async move {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue