Ember.js有时不显示错误 [英] Ember.js sometimes not showing errors

查看:82
本文介绍了Ember.js有时不显示错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有时,ember应用程序崩溃,通常在较早阶段执行某些操作时,但我并没有真正看到一个模式,并且没有错误记录到控制台。

Sometimes the ember app crashes, normally when I do something at an earlier stage, but I haven't really seen a pattern - and no error is logged to the console.

如果我将渲染的应用程序的内容中的某个位置设置为 TRY_CATCH_ERROR.error = e; ,那么我可以看到错误 - 但是必须有一个简单的

I can see the error if I set a break point to TRY_CATCH_ERROR.error = e; somewhere in the guts of the rendered app - but there has to be a simpler way I guess.

推荐答案

所有错误:

Ember.onerror = function(error) {
   console.log(error)
}



< -error-in-productionrel =nofollow>实施Ember.onerror钩子来记录生产中的所有错误

对于承诺:

Ember.RSVP.on('error', function(error) {
  Ember.Logger.assert(false, error);
});

RSVP.Promise内的错误

运行循环堆栈跟踪

Ember.run.backburner.DEBUG = true;

Ember .run.later(Backburner.js)

这篇关于Ember.js有时不显示错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆