File tree Expand file tree Collapse file tree 1 file changed +16
-14
lines changed Expand file tree Collapse file tree 1 file changed +16
-14
lines changed Original file line number Diff line number Diff line change @@ -335,20 +335,22 @@ def _handshake(self):
335335 self ._send_packet (packet )
336336
337337 def connect (self ):
338- self .websocket = websocket .WebSocket (sslopt = {"cert_reqs" : ssl .CERT_NONE })
339- self .websocket .connect (
340- self .cloud_host ,
341- cookie = self .cookie ,
342- origin = self .origin ,
343- enable_multithread = True ,
344- timeout = self .ws_timeout ,
345- header = self .header
346- )
347- self ._handshake ()
348- self .active_connection = True
349- if self .print_connect_message :
350- print ("Connected to cloud server " , self .cloud_host )
351-
338+ try :
339+ self .websocket = websocket .WebSocket (sslopt = {"cert_reqs" : ssl .CERT_NONE })
340+ self .websocket .connect (
341+ self .cloud_host ,
342+ cookie = self .cookie ,
343+ origin = self .origin ,
344+ enable_multithread = True ,
345+ timeout = self .ws_timeout ,
346+ header = self .header
347+ )
348+ self ._handshake ()
349+ self .active_connection = True
350+ if self .print_connect_message :
351+ print ("Connected to cloud server " , self .cloud_host )
352+ except WebSocketBadStatusException as e :
353+ print (f"Error: { e } --- Scratch's Cloud system may be down. Please try again later." )
352354 def disconnect (self ):
353355 self .active_connection = False
354356 if self .recorder is not None :
You can’t perform that action at this time.
0 commit comments