josephg / ShareJS

Collaborative editing in any app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Improve error handling

dignifiedquire opened this issue · comments

At the moment there are console.log and console.warn statements all over the place (here and in livedb). But when trying to debug anything they do not really help.

I suggest to emit events, error and warn, that get passed in all relevant information to what went wrong to make this actually useful.

As well here: https://github.com/share/ShareJS/blob/master/lib/server/session.js#L665 it is always console.trace 'refused' submit middleware, spamming console log, even if it's just a permission error or similar.
Please add events to handle errors, and allow user to handle them. If not handled by code, then console log with suggestions to handle. Otherwise it is really annoying to rudely spam developers console, increasing logs sizes on server.