mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
added error logging
This commit is contained in:
parent
0d02241b46
commit
de010cf971
1 changed files with 7 additions and 0 deletions
|
@ -1,14 +1,21 @@
|
|||
ChatHandler = require("./ChatHandler")
|
||||
EditorRealTimeController = require("../Editor/EditorRealTimeController")
|
||||
logger = require("logger-sharelatex")
|
||||
|
||||
module.exports =
|
||||
|
||||
|
||||
sendMessage: (project_id, user_id, messageContent, callback)->
|
||||
ChatHandler.sendMessage project_id, user_id, messageContent, (err, builtMessge)->
|
||||
if err?
|
||||
logger.err err:err, project_id:project_id, user_id:user_id, messageContent:messageContent, "problem sending message to chat api"
|
||||
return callback(err)
|
||||
EditorRealTimeController.emitToRoom project_id, "new-chat-message", builtMessge, (err)->
|
||||
callback(err)
|
||||
|
||||
getMessages: (project_id, query, callback)->
|
||||
ChatHandler.getMessages project_id, query, (err)->
|
||||
if err?
|
||||
logger.err err:err, query:query, "problem getting messages from chat api"
|
||||
return callback(err)
|
||||
callback()
|
||||
|
|
Loading…
Reference in a new issue