Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/commands/auth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,13 @@ pub enum AuthCommands {
pub async fn handle(command: &AuthCommands, cli: &crate::Cli) -> Result<()> {
match command {
AuthCommands::Login { token } => {
let config = storage::load_config().unwrap_or_default();
let config = storage::load_config()
.inspect_err(|e| {
let _ = Term::stderr().write_line(&format!(
"Warning: Config file has errors, using default settings: {e}"
));
})
.unwrap_or_default();
Comment on lines +42 to +48

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 Info: Inconsistent config error handling across call sites

The PR adds a user-facing warning when load_config() fails in the Login handler, but the other call site in src/lib.rs:74 (create_client) propagates the error with ? instead. This means a corrupted config causes auth login to silently fall back to defaults (now with a warning), while auth status and all other commands using create_client() will hard-fail. This is intentional — login needs to work even with a broken config so the user can re-authenticate — but it's worth noting the asymmetry.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

let api_url = config
.api_url
.as_deref()
Expand Down
Loading