Skip to content

Commit

Permalink
Fixes error codes
Browse files Browse the repository at this point in the history
  • Loading branch information
hbcarlos committed Oct 18, 2023
1 parent 3364a94 commit e8cfadf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions jupyter_collaboration/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]:
Expand All @@ -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.",
)

Expand Down
2 changes: 1 addition & 1 deletion packages/docprovider/src/yprovider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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, [
Expand Down

0 comments on commit e8cfadf

Please sign in to comment.