Merge pull request #185 from overleaf/jpa-doc-id-in-error-context

[misc] add/bring back doc_id in error context
This commit is contained in:
Jakob Ackermann 2020-08-25 11:42:41 +02:00 committed by GitHub
commit 849a1cf416

View file

@ -28,7 +28,7 @@ let Router
module.exports = Router = { module.exports = Router = {
_handleError(callback, error, client, method, attrs) { _handleError(callback, error, client, method, attrs) {
attrs = attrs || {} attrs = attrs || {}
for (const key of ['project_id', 'doc_id', 'user_id']) { for (const key of ['project_id', 'user_id']) {
attrs[key] = client.ol_context[key] attrs[key] = client.ol_context[key]
} }
attrs.client_id = client.id attrs.client_id = client.id
@ -275,7 +275,9 @@ module.exports = Router = {
WebsocketController.leaveDoc(client, doc_id, function (err, ...args) { WebsocketController.leaveDoc(client, doc_id, function (err, ...args) {
if (err) { if (err) {
Router._handleError(callback, err, client, 'leaveDoc') Router._handleError(callback, err, client, 'leaveDoc', {
doc_id
})
} else { } else {
callback(null, ...args) callback(null, ...args)
} }