Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes error codes #208

Merged
merged 1 commit into from
Oct 18, 2023
Merged
Show file tree
Hide file tree
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: 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
Loading