(args: &[String], output: &OpenclawCommandOutput)
| 601 | } |
| 602 | |
| 603 | fn openclaw_command_failed(args: &[String], output: &OpenclawCommandOutput) -> Box<dyn Error> { |
| 604 | let stderr = output.stderr.trim(); |
| 605 | let stdout = output.stdout.trim(); |
| 606 | let detail = if !stderr.is_empty() { |
| 607 | stderr |
| 608 | } else if !stdout.is_empty() { |
| 609 | stdout |
| 610 | } else { |
| 611 | "no command output" |
| 612 | }; |
| 613 | format!( |
| 614 | "`openclaw {}` failed (exit code {}): {}", |
| 615 | args.join(" "), |
| 616 | output |
| 617 | .status_code |
| 618 | .map(|code| code.to_string()) |
| 619 | .unwrap_or_else(|| "unknown".to_string()), |
| 620 | detail |
| 621 | ) |
| 622 | .into() |
| 623 | } |
| 624 | |
| 625 | fn is_missing_config_path_error(message: &str) -> bool { |
| 626 | let lower = message.to_ascii_lowercase(); |
no outgoing calls
no test coverage detected