Skip to content

Commit

Permalink
Improve "unexpected response" error messages
Browse files Browse the repository at this point in the history
Vary test to allow distinguishing the errors, and include the expected response.
  • Loading branch information
Timmmm committed Jul 13, 2024
1 parent a27ea3c commit 9b2ed18
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Plotter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ SResult<> Cut(CutParams p)
return Err(std::string("Moving, please try again."));
if (resp == "2\x03")
return Err(std::string("Empty tray, please load media.")); // Silhouette Cameo
return Err("Unexpected response from plotter: '" + resp + "' (" + string_to_hex(resp) + ")");
return Err("Unexpected response from plotter status request: '" + resp + "' (hex: " + string_to_hex(resp) + "), expected \"0\\x03\"");
}

// Home the cutter.
Expand Down Expand Up @@ -426,7 +426,7 @@ SResult<> Cut(CutParams p)
resp = sr.unwrap();

if (resp != " 0, 0\x03")
return Err("Unexpected response from plotter: '" + resp + "' (" + string_to_hex(resp) + ")");
return Err("Unexpected response from plotter configuration: '" + resp + "' (hex: " + string_to_hex(resp) + "), expected \" 0, 0\\x03\"");

// Begin page definition.
e = UsbSend(handle, "FA\x03");
Expand Down

0 comments on commit 9b2ed18

Please sign in to comment.