Project status
Installation
You can install via package manager, simply download the compiled version as zip file here and inject or request via cdn in HTML:
npm install errorreporter
<script src="https://unpkg.com/errorreporter@latest/index.js"></script>
Use case
A client side error reporter written in JavaScript. Embed this code into your website markup and get an ajax call to a specified resource for each distinct error with detailed client information. You can filter each non-supported client technology to avoid getting error reports from environments which aren't expected.
<div id="error-output"></div>
errorreporter.globalContext.fetch = (url, options) => {
document.querySelector('#error-output').textContent =
JSON.parse(options.body).errorMessage
return Promise.resolve()
}
Promise.reject('Example error')