From b734f7a3f7478a718323c8ada0327dec127954d8 Mon Sep 17 00:00:00 2001 From: Brian Gough Date: Fri, 10 Nov 2017 15:01:23 +0000 Subject: [PATCH] convert errors to warnings --- .../real-time/app/coffee/DocumentUpdaterController.coffee | 2 +- services/real-time/app/coffee/Router.coffee | 4 ++-- services/real-time/app/coffee/WebsocketController.coffee | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/services/real-time/app/coffee/DocumentUpdaterController.coffee b/services/real-time/app/coffee/DocumentUpdaterController.coffee index 01a8732a2a..451dc812bc 100644 --- a/services/real-time/app/coffee/DocumentUpdaterController.coffee +++ b/services/real-time/app/coffee/DocumentUpdaterController.coffee @@ -36,7 +36,7 @@ module.exports = DocumentUpdaterController = _processErrorFromDocumentUpdater: (io, doc_id, error, message) -> for client in io.sockets.clients(doc_id) - logger.error err: error, doc_id: doc_id, client_id: client.id, "error from document updater, disconnecting client" + logger.warn err: error, doc_id: doc_id, client_id: client.id, "error from document updater, disconnecting client" client.emit "otUpdateError", error, message client.disconnect() diff --git a/services/real-time/app/coffee/Router.coffee b/services/real-time/app/coffee/Router.coffee index d59853e831..ad74ebffa1 100644 --- a/services/real-time/app/coffee/Router.coffee +++ b/services/real-time/app/coffee/Router.coffee @@ -21,7 +21,7 @@ module.exports = Router = attrs[key] = value attrs.client_id = client.id attrs.err = error - if error.message in ["not authorized", "doc updater could not load requested ops"] + if error.message in ["not authorized", "doc updater could not load requested ops", "no project_id found on client"] logger.warn attrs, error.message return callback {message: error.message} else @@ -40,7 +40,7 @@ module.exports = Router = session.on 'connection', (error, client, session) -> if client? and error?.message?.match(/could not look up session by key/) - logger.err err: error, client: client?, session: session?, "invalid session" + logger.warn err: error, client: client?, session: session?, "invalid session" # tell the client to reauthenticate if it has an invalid session key client.emit("connectionRejected", {message: "invalid session"}) client.disconnect() diff --git a/services/real-time/app/coffee/WebsocketController.coffee b/services/real-time/app/coffee/WebsocketController.coffee index 77b797d560..abc50aedf0 100644 --- a/services/real-time/app/coffee/WebsocketController.coffee +++ b/services/real-time/app/coffee/WebsocketController.coffee @@ -182,7 +182,7 @@ module.exports = WebsocketController = return callback(new Error("no project_id found on client")) if !project_id? WebsocketController._assertClientCanApplyUpdate client, doc_id, update, (error) -> if error? - logger.error {err: error, doc_id, client_id: client.id, version: update.v}, "client is not authorized to make update" + logger.warn {err: error, doc_id, client_id: client.id, version: update.v}, "client is not authorized to make update" setTimeout () -> # Disconnect, but give the client the chance to receive the error client.disconnect()