Skip to content

Commit

Permalink
fix(telnet,rpc_server): correctly surface command errors
Browse files Browse the repository at this point in the history
  • Loading branch information
abesto authored and rdaum committed Jul 10, 2024
1 parent 02ab1a9 commit 567c768
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
4 changes: 2 additions & 2 deletions crates/telnet-host/src/telnet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ impl TelnetConnection {
match task_error {
SchedulerError::CommandExecutionError(CommandError::CouldNotParseCommand) => {
self.write
.send("I don't understand that.".to_string())
.send("I couldn't understand that.".to_string())
.await?;
}
SchedulerError::CommandExecutionError(CommandError::NoObjectMatch) => {
Expand All @@ -341,7 +341,7 @@ impl TelnetConnection {
}
SchedulerError::CommandExecutionError(CommandError::NoCommandMatch) => {
self.write
.send("I don't understand that.".to_string())
.send("I couldn't understand that.".to_string())
.await?;
}
SchedulerError::CommandExecutionError(CommandError::PermissionDenied) => {
Expand Down
7 changes: 7 additions & 0 deletions crates/telnet-host/tests/integration_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -155,3 +155,10 @@ fn test_echo() {
fn test_suspend_read_notify() {
test_moot_with_telnet_host("suspend_read_notify");
}

#[cfg(target_os = "linux")]
#[test]
#[serial(telnet_host)]
fn test_huh() {
test_moot_with_telnet_host("huh");
}
4 changes: 4 additions & 0 deletions crates/telnet-host/tests/moot/huh.moot
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// The test core doesn't define a `huh` verb.
// Test that we get the correct default `huh` message.
% discombobulate
=I couldn't understand that.

0 comments on commit 567c768

Please sign in to comment.