forked from openSUSE/open-build-service
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduces client side javascript error tracking
As a developer you might be interested in exceptions that occur in the javascript that is running in the users browser. Separate this with another errbit configuration key because this is getting exposed publicly.
- Loading branch information
1 parent
d89df6e
commit ba660a5
Showing
6 changed files
with
44 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
//= require airbrake-js-client | ||
var errbit_id = "<%= CONFIG['errbit_javascript_api_key'] %>"; | ||
var errbit_host = "<%= CONFIG['errbit_javascript_host'] %>"; | ||
|
||
if (errbit_id) { | ||
var airbrake = new airbrakeJs.Client({ | ||
projectId: 1, | ||
projectKey: errbit_id, | ||
host: errbit_host, | ||
environment: 'production', | ||
}); | ||
|
||
window.onerror = function (message, file, line, col, error) { | ||
var promise = airbrake.notify(error); | ||
promise.then(function(notice) { | ||
if (notice.id) { | ||
// console.log('Notified errbit. Notice:', notice.id); | ||
console.log('Notified errbit.'); | ||
} else { | ||
// console.log('Notifying errbit failed. Reason:', notice.error); | ||
console.log('Notifying errbit failed!'); | ||
} | ||
}); | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters