Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
client-side error beacon code in coffeescript
class YourNamespace.Errors
window.onerror = (e) => @report(e)
@report: (e) ->
img = new Image(1,1)
img.src = '//' + your_config.errors_host + '/images/error_pixel.gif''none'

This comment has been minimized.

Copy link
Owner Author

@eanakashima eanakashima commented Dec 10, 2013

Just a sketch. You may also want to check if window.onerror has already been set, since other code or third-party tools may already have set a handler there, and call that function as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment