Log more information in the client side errors

This commit is contained in:
James Allen 2014-03-14 17:23:50 +00:00
parent 5efd19ffc4
commit a99783edc7
3 changed files with 15 additions and 2 deletions

View file

@ -94,8 +94,11 @@ define [
INFLIGHT_OP_TIMEOUT: 10000
_startInflightOpTimeout: (update) ->
meta =
v: update.v
op_sent_at: new Date()
timer = setTimeout () =>
@_handleError new Error("Doc op was not acknowledged in time"), v: update.v
@_handleError new Error("Doc op was not acknowledged in time"), meta
, @INFLIGHT_OP_TIMEOUT
@_doc.inflightCallbacks.push () =>
clearTimeout timer

View file

@ -158,7 +158,13 @@ define [
}
reportError: (error, meta = {}) ->
meta.client_id = @socket.socket.sessionid
meta.client_id = @socket?.socket?.sessionid
meta.transport = @socket?.socket?.transport?.name
meta.client_now = new Date()
meta.last_connected = @connectionManager.lastConnected
meta.second_last_connected = @connectionManager.secondLastConnected
meta.last_disconnected = @connectionManager.lastDisconnected
meta.second_last_disconnected = @connectionManager.secondLastDisconnected
errorObj = {}
for key in Object.getOwnPropertyNames(error)
errorObj[key] = error[key]

View file

@ -8,11 +8,15 @@ define [
@socket = @ide.socket
@socket.on "connect", () =>
@connected = true
@secondLastConnected = @lastConnected
@lastConnected = new Date()
@hideModal()
@cancelReconnect()
@socket.on 'disconnect', () =>
@connected = false
@secondLastDisconnected = @lastDisconnected
@lastDisconnected = new Date()
@ide.trigger "disconnect"
setTimeout(=>
ga('send', 'event', 'editor-interaction', 'disconnect')