From 9b2ed1863190702bdbd0c688f2ba40af69e54273 Mon Sep 17 00:00:00 2001 From: Tim Hutt Date: Sat, 13 Jul 2024 22:00:03 +0100 Subject: [PATCH] Improve "unexpected response" error messages Vary test to allow distinguishing the errors, and include the expected response. --- Plotter.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Plotter.cpp b/Plotter.cpp index ed6983b7..84b75ac6 100644 --- a/Plotter.cpp +++ b/Plotter.cpp @@ -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. @@ -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");