Skip to content

Commit

Permalink
resend_request_communication_errors was too narrow
Browse files Browse the repository at this point in the history
Didn't match Marlin's "checksum mismatch", only Repetier's "checksum
error". Since the error handler checks against
recoverable_communication_errors before
resend_request_communication_errors, we can just switch back to the more
broader check against "checksum" for the latter.

We could also have added an explicit check for "checksum mismatch"
instead but since we used to check for "checksum" and we don't know what
other varieties for this specific error might be out there in the
thousands of firmware variants (who needs consistency when they can
have a free for all?), we'll err on the side of caution instead.

Fixes #2262
  • Loading branch information
foosel committed Dec 4, 2017
1 parent f72dfb4 commit 2639256
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions src/octoprint/util/comm.py
Expand Up @@ -1953,18 +1953,19 @@ def default(_, port, baudrate, read_timeout):

return False

_resend_request_communication_errors = ("line number",
"wrong checksum",
"missing checksum",
"format error",
"expected line")
_recoverable_communication_errors = ("no line number with checksum",)
_sd_card_errors = ("volume.init",
"openroot",
"workdir",
"error writing to file",
"cannot open",
"cannot enter")
_recoverable_communication_errors = ("no line number with checksum",)
_resend_request_communication_errors = ("line number", # since this error class get's checked after recoverable
# communication errors, we can use this broad term here
"checksum", # since this error class get's checked after recoverable
# communication errors, we can use this broad term here
"format error",
"expected line")
_sd_card_errors = ("volume.init",
"openroot",
"workdir",
"error writing to file",
"cannot open",
"cannot enter")
def _handle_errors(self, line):
if line is None:
return
Expand Down

0 comments on commit 2639256

Please sign in to comment.