safely(keepGoingIfThisFunctionFails)Exceptions are caught and automatically reported to your favorite reporting service.
In development and test environments, exceptions are raised so you can fix them.
“Oh no, analytics brought down search”
safely(trackSearch)Also aliased as yolo.
Download safely.js, include it, and set the environment
<script src="path/to/safely.js"></script>
<script>
Safely.env = "production"
</script>Reports exceptions to Rollbar out of the box.
Customize reporting with:
Safely.reportExceptionMethod = function (e) {
// report to your favorite service
}By default, exception messages are prefixed with [safely]. This makes it easier to spot caught exceptions. Turn this off with:
Safely.tag = falseTo report exceptions manually:
Safely.reportException(e)View the changelog
Everyone is encouraged to help improve this project. Here are a few ways you can help:
- Report bugs
- Fix bugs and submit pull requests
- Write, clarify, or fix documentation
- Suggest or add new features