Просмотр исходного кода

Merge pull request #25 from sharelatex/bg-convert-errors-to-warnings

convert errors to warnings
Brian Gough 9 лет назад
Родитель
Сommit
83e3312fd8

+ 1 - 1
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()
 

+ 2 - 2
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()

+ 1 - 1
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()