Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion scratchattach/cloud/cloud.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from scratchattach.utils import exceptions, commons
from scratchattach.site import cloud_activity

from websocket import WebSocketBadStatusException

class ScratchCloud(BaseCloud):
def __init__(self, *, project_id, _session=None):
Expand All @@ -26,7 +27,10 @@ def __init__(self, *, project_id, _session=None):

def connect(self):
self._assert_auth() # Connecting to Scratch's cloud websocket requires a login to the Scratch website
super().connect()
try:
super().connect()
except WebSocketBadStatusException as e:
raise WebSocketBadStatusException(f"Error: Scratch's Cloud system may be down. Please try again later.") from e

def set_var(self, variable, value):
self._assert_auth() # Setting a cloud var requires a login to the Scratch website
Expand Down