From 46dfe56b05b0ccced45a4b35ddff7262fc7fae93 Mon Sep 17 00:00:00 2001 From: miguel Date: Fri, 21 Jun 2019 07:30:12 +0200 Subject: [PATCH] Downgraded unathorised log to warning --- services/real-time/app/coffee/WebsocketController.coffee | 2 +- .../test/unit/coffee/WebsocketControllerTests.coffee | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/services/real-time/app/coffee/WebsocketController.coffee b/services/real-time/app/coffee/WebsocketController.coffee index 96a74b9748..470b1f2a52 100644 --- a/services/real-time/app/coffee/WebsocketController.coffee +++ b/services/real-time/app/coffee/WebsocketController.coffee @@ -22,7 +22,7 @@ module.exports = WebsocketController = if !privilegeLevel or privilegeLevel == "" err = new Error("not authorized") - logger.error {err, project_id, user_id, client_id: client.id}, "user is not authorized to join project" + logger.warn {err, project_id, user_id, client_id: client.id}, "user is not authorized to join project" return callback(err) client.join project_id diff --git a/services/real-time/test/unit/coffee/WebsocketControllerTests.coffee b/services/real-time/test/unit/coffee/WebsocketControllerTests.coffee index 965f5d72b2..1ddf4e6359 100644 --- a/services/real-time/test/unit/coffee/WebsocketControllerTests.coffee +++ b/services/real-time/test/unit/coffee/WebsocketControllerTests.coffee @@ -116,7 +116,10 @@ describe 'WebsocketController', -> @callback .calledWith(new Error("not authorized")) .should.equal true - + + it "should not log an error", -> + @logger.error.called.should.equal false + describe "leaveProject", -> beforeEach -> @DocumentUpdaterManager.flushProjectToMongoAndDelete = sinon.stub().callsArg(1)