Skip to content

Commit

Permalink
4.0.4dev1
Browse files Browse the repository at this point in the history
increase WS connection timeout to 15 seconds from 5 seconds
add exception details to file download message being sent back to SP
  • Loading branch information
jneilliii committed Nov 27, 2022
1 parent 15bb6c0 commit b9291e1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions octoprint_simplyprint/websocket/file_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,11 +146,11 @@ def _download_sp_file(self, url: str, start: bool):
if pct != last_pct:
last_pct = pct
self._update_progress(pct)
except Exception:
except Exception as e:
self._logger.exception("Error downloading print")
self._loop.add_callback(
self.socket.send_sp, "file_progress",
{"state": "error", "message": "Network Error"}
{"state": "error", "message": "Network Error", "exception": e}
)
return
local = FileDestinations.LOCAL
Expand Down Expand Up @@ -178,11 +178,11 @@ def _download_sp_file(self, url: str, start: bool):
fparts = filename.split(".", 1)
ext = "gcode" if len(fparts) < 2 else fparts[-1]
filename = f"{fparts[0]}_copy{count}.{ext}"
except Exception:
except Exception as e:
self._logger.exception("Error locating file destination")
self._loop.add_callback(
self.socket.send_sp, "file_progress",
{"state": "error", "message": "Error processing download"}
{"state": "error", "message": "Error processing download", "exception": e}
)
return
else:
Expand Down
2 changes: 1 addition & 1 deletion octoprint_simplyprint/websocket/simplyprint.py
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ async def _connect(self) -> None:
if not reachable:
raise Exception("SimplyPrint not Reachable")
self.ws = await tornado.websocket.websocket_connect(
url, connect_timeout=5.
url, connect_timeout=15.
)
setattr(self.ws, "on_ping", self._on_ws_ping)
cur_time = self._monotonic()
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

# The plugin's version. Can be overwritten within OctoPrint's internal data via __plugin_version__ in the plugin module
# Remember to bump the version in octoprint_simplyprint/__init__.py as well
plugin_version = "4.0.3"
plugin_version = "4.0.4dev1"

# The plugin's description. Can be overwritten within OctoPrint's internal data via __plugin_description__ in the plugin
# module
Expand Down

0 comments on commit b9291e1

Please sign in to comment.