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
17 changes: 13 additions & 4 deletions crates/chisel/src/dispatcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,10 @@ impl ChiselDispatcher {
self.session.id.as_ref().unwrap()
)))
} else {
DispatchResult::CommandFailed(Self::make_error("Too many arguments supplied!"))
DispatchResult::CommandFailed(Self::make_error(format!(
"Too many arguments supplied: [{}]. Please check command syntax.",
args.join(", ")
)))
}
}
ChiselCommand::Load => {
Expand Down Expand Up @@ -333,7 +336,9 @@ impl ChiselDispatcher {
self.session.id = None;
DispatchResult::CommandSuccess(Some(String::from("Cleared chisel cache!")))
}
Err(_) => DispatchResult::CommandFailed(Self::make_error("Failed to clear cache!")),
Err(_) => DispatchResult::CommandFailed(Self::make_error(
"Failed to clear cache! Check file permissions or disk space.",
)),
},
ChiselCommand::Fork => {
if args.is_empty() || args[0].trim().is_empty() {
Expand Down Expand Up @@ -371,7 +376,9 @@ impl ChiselDispatcher {

// Check validity of URL
if Url::parse(&fork_url).is_err() {
return DispatchResult::CommandFailed(Self::make_error("Invalid fork URL!"))
return DispatchResult::CommandFailed(Self::make_error(
"Invalid fork URL! Please provide a valid RPC endpoint URL.",
))
}

// Create success message before moving the fork_url
Expand Down Expand Up @@ -634,7 +641,9 @@ impl ChiselDispatcher {
}
ChiselCommand::Exec => {
if args.is_empty() {
return DispatchResult::CommandFailed(Self::make_error("No command supplied!"))
return DispatchResult::CommandFailed(Self::make_error(
"No command supplied! Please provide a valid command after '!'.",
))
}

let mut cmd = Command::new(args[0]);
Expand Down