Expected Errors
The following errors are embedded in this page. The collector should catch each one:
- JavaScript runtime error (undefined variable reference)
- Unhandled promise rejection (fetch to non-existent URL)
- Resource error: broken image src
- Resource error: broken script src
- Delayed JavaScript error (setTimeout that throws)
Errors caught: 0
Waiting for errors to fire...
Error Sources
Here is what generates each error on this page:
1. JS Runtime Error — Referencing an undefined variable
var name = undeclaredObject.property;
2. Promise Rejection — Fetch to a non-existent URL
fetch('/api/does-not-exist').then(r => r.json())
3. Broken Image — Image with invalid src
<img src="/images/does-not-exist.png">
4. Broken Script — Script tag pointing to 404
<script src="/scripts/does-not-exist.js">
5. Delayed Error — setTimeout that throws after 1.5 seconds
setTimeout(function() { null.property; }, 1500)