A small library to keep track of errors after deployment.
Example of a situation:
After you released your fancy new website, some people will start to send you emails about a bug that you never experienced. Unfortunately, these persons aren't developers and have no idea of what the inspector is, so you can't ask them to take a screenshot of the error. And because of that, this error will always happen to some people, which is a big issue.
Catch was created to fix that. You can detect errors, and send a fetch request with the content of the error and additional information.
Open a terminal
npm i catch.js
Now in your NodeJS file
const d = require("catch.js")(err => {
// Do something when there is an error
})
At the end of your
<body>
tag
<!-- Make sure this is the first script to be loaded -->
<script src="https://unpkg.com/catch.js"></script>
In your JavaScript file
const d = new Catch(err => {
// Do something when there is an error
})
When there is an error, Catch will automatically run a function and it will pass it an object. Here are all its properties:
-
err
: The error message (String) -
time
: When the error was thrown (String)
-
err
: The error message (String) -
src
: The file that thrown the error -
line
: The line where the error was thrown -
column
: The column where the error was thrown -
errObj
: A nativeErrorObject
that contains all the information about the error. -
time
: When the error was thrown (String) -
userAgent
: Browser version and information
I recommend using html2canvas
in addition to this library to get a screenshot of the website.
ProType is a project that required a lot of work and effort. You can show your appreciation by leaving a ⭐️. But you can also contribute in a 'financial' way by giving to my Patreon
Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.
We use SemVer for versioning. For the versions available, see the tags on this repository.
- Arthur Guiot - Initial work - @arguiot
See also the list of contributors who participated in this project. If you don't code but you have great ideas, don't hesitate to write your idea in the issue part. If your idea is accepted, I will add you to this list 😊.
- Thank You
- for support
This project is licensed under the MIT License - see the LICENSE file for details.
Copyright © 2017 Arthur Guiot All Rights Reserved.