https://github.com/zimbatm/browser-error-reporter
Be notified of all those nasty client errors
https://github.com/zimbatm/browser-error-reporter
Last synced: 4 months ago
JSON representation
Be notified of all those nasty client errors
- Host: GitHub
- URL: https://github.com/zimbatm/browser-error-reporter
- Owner: zimbatm
- License: mit
- Created: 2012-04-28T23:41:33.000Z (about 14 years ago)
- Default Branch: master
- Last Pushed: 2023-12-15T02:55:47.000Z (over 2 years ago)
- Last Synced: 2025-01-29T08:11:12.502Z (over 1 year ago)
- Language: JavaScript
- Homepage: http://zimbatm.github.com/browser-error-reporter
- Size: 445 KB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Status: retired - use http://getsentry.com
Browser error reporter
======================
Are you like me, wondering how many underported client errors are just
hidden from us ? Well.. you can stop being in the dark today !
With just a couple of steps, you will start getting all these nasty
errors that you never saw because who tests his site in IE anymore ?
Install that thing
==================
1: Insert the script as early as possible in your page to not miss any
errors. Eg:
```html
...
```
2: Change your webapp to accept POST requests on the "/error_report"
end-point. For example in Rails, I use this kind of controller to
forward the errors to [Airbrake](http://airbrakeapp.com/).
```ruby
# app/controllers/failing_controller.rb
class FailingController < ApplicationController
def index
# We should get message, file and line parameters from the
# JavaScript client
raise params[:message] || "this page should fail!"
end
end
# in config/routes.rb:
post '/report_error' => 'failing#index'
```
When the controller raises an exception, airbreak catches it an forwards
it to their server, where all exceptions are nicely categorized.
(Examples for other kind of backends are welcome)
3: Profit !
If you have any issues, just add it to the [bug tracker](https://github.com/zimbatm/browser-error-reporter/issues) and I'll take a
look.
Status
======
This script is actually running on [PandaStream](http://www.pandastream.com) and has helped me find a couple of unknown JavaScript issues. I'm still not 100% confident in it but it's good enough that it doesn't hurt.
Design
======
The JavaScript has no external dependencies and is kept as small as
possible. This to avoid the error reporter having errors himself.
The "/error_report" is hard-coded to avoid another possible cause of
error. We're trying to collect errors so it's quite crucial to not
introduce our own issues. If you don't like the path of the end-point,
you'll need to change it by hand. Search for "/report_error" in the script
and replace it to your liking !
Licence: MIT
Cheers,
zimbatm