Skip to content

Commit 13fedbd

Browse files
authored
Improve error messages for dispatch failures (#2969)
1 parent 37a77e0 commit 13fedbd

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

crates/chat-cli/src/auth/mod.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,17 @@ pub use builder_id::{
1414
pub use consts::START_URL;
1515
use thiserror::Error;
1616

17+
use crate::aws_common::SdkErrorDisplay;
18+
1719
#[derive(Debug, Error)]
1820
pub enum AuthError {
1921
#[error(transparent)]
2022
Ssooidc(Box<aws_sdk_ssooidc::Error>),
21-
#[error(transparent)]
23+
#[error("{}", SdkErrorDisplay(.0))]
2224
SdkRegisterClient(Box<SdkError<RegisterClientError>>),
23-
#[error(transparent)]
25+
#[error("{}", SdkErrorDisplay(.0))]
2426
SdkCreateToken(Box<SdkError<CreateTokenError>>),
25-
#[error(transparent)]
27+
#[error("{}", SdkErrorDisplay(.0))]
2628
SdkStartDeviceAuthorization(Box<SdkError<StartDeviceAuthorizationError>>),
2729
#[error(transparent)]
2830
Io(#[from] std::io::Error),

crates/chat-cli/src/cli/agent/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1189,8 +1189,8 @@ mod tests {
11891189
let execute_name = if cfg!(windows) { "execute_cmd" } else { "execute_bash" };
11901190
let execute_bash_label = agents.display_label(execute_name, &ToolOrigin::Native);
11911191
assert!(
1192-
execute_bash_label.contains("read-only"),
1193-
"execute_bash should show read-only by default, instead found: {}",
1192+
execute_bash_label.contains("not trusted"),
1193+
"execute_bash should not be trusted by default, instead found: {}",
11941194
execute_bash_label
11951195
);
11961196
}

0 commit comments

Comments
 (0)