safely(keepGoingIfThisFunctionFails)
Exceptions are rescued 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 aliases 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 rescued exceptions. Turn this off with:
Safely.tag = false
To report exceptions manually:
Safely.reportException(e)
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