TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

The State of Client side JavaScript Error Reporting

38 点作者 benarent超过 11 年前

8 条评论

wbond超过 11 年前
I was hoping for some info about handling the glut of false positives in Chrome when monitoring a site for JS errors using onerror. From what I can tell, they are caused by the fact that Chrome extensions run inline on pages.<p>It seems to me Airbrake is just requiring that you wrap all of your JS in calls to Airbrake.try(). Wouldn&#x27;t this end up littering your whole app with Airbrake calls in every event handler?
评论 #6532324 未加载
评论 #6531376 未加载
评论 #6531670 未加载
评论 #6532074 未加载
russelldavis超过 11 年前
No need to clutter your code with a bunch of try wrappers like this suggests. There&#x27;s a much better way. It turns out that in a typical web app, a handful of operations account for the vast majority of new execution contexts:<p><pre><code> - setTimeout&#x2F;setInterval - event handlers - ajax response handlers </code></pre> Wrap those entry points (along with a single top-level wrapper which can be done as a build step) and you&#x27;re almost entirely covered. If you use jQuery along with TraceKit, this plugin does it for you: <a href="https://github.com/getsentry/raven-js/blob/master/plugins/jquery.js" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;getsentry&#x2F;raven-js&#x2F;blob&#x2F;master&#x2F;plugins&#x2F;jq...</a>
nathan_f77超过 11 年前
I&#x27;ve done a bit of work to flesh out the jQuery integration in our fork of the airbrake notifier, to automatically wrap all event handlers and AJAX callbacks. Which is great, because it means our entire Backbone app gets a full stack trace with line and column numbers. I should really submit a pull request.<p>Also very excited about the proposals about having the error object passed to window.onerror... well, I used to be. I&#x27;ve had a little bit of involvement in the W3C mailing lists over the last few years, but it seems like nothing ever gets done.<p>And source maps support would be awesome! Just as soon as we can get source maps from sprockets, which seems like it&#x27;s on the way [1].<p>[1] <a href="https://github.com/sstephenson/sprockets/pull/311" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;sstephenson&#x2F;sprockets&#x2F;pull&#x2F;311</a>
james33超过 11 年前
We are currently using Sentry to handle JS error reporting. It appears that this is essentially the same thing, am I missing anything that sets it apart and makes it better?
评论 #6531471 未加载
bvirkler超过 11 年前
Missing a closing paren on the Airbrake.try example. Otherwise, looking good!
k3n超过 11 年前
Does it handle uncaught errors such as a window.onerror function might do?
评论 #6531203 未加载
dbreaker超过 11 年前
Great approach by the airbrake team. Nice work.
评论 #6531103 未加载
tomphoolery超过 11 年前
Interesting, can&#x27;t wait to try this out!
评论 #6531102 未加载