Comments (2)
建议添加固定的异常类型作为前缀,例如:
throw new Error('CustomError: Exceed the maximal count of style tags in IE')
好处:
- 避免和浏览器自动抛出的异常混淆。
- 便于调试。
from wiki.
全局方案,待定。
(function(global){
var custom = "CustomError: ";
var _Error = global.Error;
global.Error = function(msg, file, line){
if(msg.indexOf(custom) !== 0){
msg = custom + msg;
}
};
global.Error.prototype = new _Error;
})(this);
from wiki.
Related Issues (20)
- 收银台cookie溢出造成用户提交413 HOT 1
- 每周异常:第 2 期(续)(20130723) HOT 1
- 讨论:异常评分算法
- 每周异常:第 3期,宏观异常分析方法 (20130802)
- 每周异常:第 4期,如何避免客户端攻击造成的大量异常报警 (20130807) HOT 2
- 每周异常:第 5期,由静态资源异常引发的质疑 (20130816)
- 每周异常:第 6期,JavaScript 异常监控脚本引发的 JavaScript 异常 (20130822) HOT 1
- 每周异常:第 7期,保持简单,保持拙朴(20130828) HOT 1
- 每周异常:第 8期,异常象限 HOT 2
- 每周异常:第 9期,搜狗浏览器中神一样的 try/catch 特性
- 使用 tags 对 JavaScript 异常进行归类
- 更新站点的皮肤样式,并链接到 totorojs.org
- 搜狗浏览器 2.x (很多版本都使用这个版本号)居然还进行主动 XSS 攻击,恶心到了
- JavaScript 异常:错误的参数个数或无效的参数属性值
- 异常消息国际化与规范化
- 补充如何贡献及其相关介绍、规范的文档
- 每周一个异常分析
- 每周异常:第 1 期 (20130715)
- 每周异常:第 2 期 (20130722) HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wiki.