Skip to content

Commit

Permalink
Merge branch 'test'
Browse files Browse the repository at this point in the history
  • Loading branch information
Zeanon committed Jan 15, 2024
2 parents 6e7f097 + 52d1d2b commit 5ffca82
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions moonraker/components/spoolman.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,6 @@ async def track_filament_usage(self):
},
)
if response.has_error():
logging.info(response._error)
if not self.has_printed_error_since_last_down:
response.raise_for_status()
self.has_printed_error_since_last_down = True
Expand All @@ -166,7 +165,7 @@ async def _handle_spool_id_request(self, web_request: WebRequest):
# For GET requests we will simply return the spool_id
return {"spool_id": self.spool_id}

async def _proxy_spoolman_request(self, web_request: WebRequest):
async def _proxy_spoolman_request(self, web_request: WebRequest, retry=False):
method = web_request.get_str("request_method")
path = web_request.get_str("path")
query = web_request.get_str("query", None)
Expand Down Expand Up @@ -197,7 +196,14 @@ async def _proxy_spoolman_request(self, web_request: WebRequest):
url=full_url,
body=body,
)
response.raise_for_status()

if (response._code == 404
and self.spool_id is not None
and dict(response.json()).get("message")
== ("No spool with ID %d found." % self.spool_id)):
await self.set_active_spool(None)
else:
response.raise_for_status()

return response.json()

Expand Down

0 comments on commit 5ffca82

Please sign in to comment.