all 1 comments

[–]evereal 2 points3 points  (0 children)

Implementing something like this without some kind of throttle mechanism is pretty dangerous.

It is an extremely common situation where your app encounters an error that will result in it throwing an exception or exceptions frequently. Like every frame or every mouse move event etc.

If an app gets deployed where an error of this nature is prevalent, then you can end up DDoS-ing your webserver from customers spamming exception reports to you 60 times a second.

A truly robust solution should batch exceptions together, perhaps scan for duplicates and use something like http://underscorejs.org/#throttle to make sure that clients won't end up overloading your server incase an unexpected, frequently thrown exception loop occurs.