On-line JS error will become an email, to the front-end development team, each person to claim, solve. In fact, this is a good choice, but also solves the most basic problem: immediate response, repair off. But there is also a problem, how to avoid the same mistakes? My initial idea is this:
- In the URL as a unit, record the same page error: Convenient Unified solution
- Log errors include: Page URL, User Agent, Script URL, error Message, line number, Stack
- After each error is resolved, you can write a solution in one place, see people can comment, add points, will eventually be archived, as a knowledge base, and with a convenient API can use the content of these knowledge base
- At the time of development, the same page
window.onerror
, through the plug-in, analysis error Message to identify the type, plus URL judgment, to give developers to remind the previous mistakes
- Developers can subscribe to certain tags in the Knowledge base, automatically receive mail (or, of course, according to file comments, mapping and other ways to do better pairing)
Why did you do that? The main purpose is to solve some of the following problems:
- Develop a knowledge base that developers can learn from, especially newcomers
- Tools to ensure efficiency improvements and avoid repetitive errors repeated resolution
- Subscription assurance notifications are more targeted
Think about how JavaScript exceptions turn into a knowledge base?