Skip to content

Commit 86c120d

Browse files
runningcodeclaude
andcommitted
fix: Display server error messages directly to users
Remove complex string matching logic and display error source directly. This shows the actual server error message (e.g., "Unsupported provider: xyz") instead of generic wrapper messages like "API request failed". 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 5124d2a commit 86c120d

1 file changed

Lines changed: 7 additions & 17 deletions

File tree

src/commands/build/upload.rs

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -309,22 +309,7 @@ pub fn execute(matches: &ArgMatches) -> Result<()> {
309309
}
310310
Err(e) => {
311311
debug!("Failed to upload file at path {}: {}", path.display(), e);
312-
// Check if this is the "Unsupported provider" error and provide a better message
313-
let error_message = if let Some(source) = e.source() {
314-
let source_str = source.to_string();
315-
if source_str.contains("Unsupported provider") {
316-
if let Some(provider) = vcs_info.vcs_provider {
317-
anyhow!("The VCS provider '{}' is not supported. Please check the --vcs-provider parameter.", provider)
318-
} else {
319-
anyhow!("The VCS provider is not supported. Please check the --vcs-provider parameter.")
320-
}
321-
} else {
322-
e
323-
}
324-
} else {
325-
e
326-
};
327-
errored_paths_and_reasons.push((path.to_path_buf(), error_message));
312+
errored_paths_and_reasons.push((path.to_path_buf(), e));
328313
}
329314
}
330315
}
@@ -340,7 +325,12 @@ pub fn execute(matches: &ArgMatches) -> Result<()> {
340325
}
341326
);
342327
for (path, reason) in errored_paths_and_reasons {
343-
warn!(" - {} ({})", path.display(), reason);
328+
// Display the root cause (source) if available, otherwise show the main error
329+
let error_msg = reason
330+
.source()
331+
.map(|source| source.to_string())
332+
.unwrap_or_else(|| reason.to_string());
333+
warn!(" - {} ({})", path.display(), error_msg);
344334
}
345335
}
346336

0 commit comments

Comments
 (0)