diff --git a/jupyter_collaboration/handlers.py b/jupyter_collaboration/handlers.py index acbe9043..438a4ee7 100644 --- a/jupyter_collaboration/handlers.py +++ b/jupyter_collaboration/handlers.py @@ -134,10 +134,10 @@ async def open(self, room_id): # Close websocket and propagate error. if isinstance(e, web.HTTPError): self.log.error(f"File {path} not found.\n{e!r}", exc_info=e) - self.close(1004, f"File {path} not found.") + self.close(4000, f"File {path} not found.") else: self.log.error(f"Error initializing: {path}\n{e!r}", exc_info=e) - self.close(1005, f"Error initializing: {path}. You need to close the document.") + self.close(4001, f"Error initializing: {path}. You need to close the document.") # Clean up the room and delete the file loader if self.room is not None and len(self.room.clients) == 0 or self.room.clients == [self]: @@ -155,7 +155,7 @@ async def open(self, room_id): f"Client tried to connect to {self._room_id} with an expired session ID {session_id}." ) self.close( - 1003, + 4002, f"Document session {session_id} expired. You need to reload this browser tab.", ) diff --git a/packages/docprovider/src/yprovider.ts b/packages/docprovider/src/yprovider.ts index 0f6887f2..c87e4484 100644 --- a/packages/docprovider/src/yprovider.ts +++ b/packages/docprovider/src/yprovider.ts @@ -136,7 +136,7 @@ export class WebSocketProvider implements IDocumentProvider { } private _onConnectionClosed = (event: any): void => { - if (event.code >= 1003 && event.code < 1006) { + if (event.code >= 4000 && event.code < 4005) { console.error('Document provider closed:', event.code, event.reason); showErrorMessage(this._trans.__('Document error'), event.reason, [