我已经在舞台环境中部署了我的ember-cli应用程序,让队友测试应用程序。在应用程序中,我已实现Ember.onerror
向我发送电子邮件,告知我在阶段和生产环境中发生的错误。
Ember.onerror = function(data) {
Ember.$.ajax({
type: "POST",
url: url + "/error",
dataType: 'json',
contentType: 'application/json',
data: JSON.stringify({message: data.message, stacktrace: data.stack}),
beforeSend: function (xhr, settings) {
xhr.setRequestHeader('Accept', settings.accepts.json);
}
});
}
我在分析堆栈跟踪时遇到了困难,因为它只引用vendor.js而我无法理解问题的确切位置。
例如,我收到了以下消息:
Message: Nothing handled the action 'back'. If you did handle the action, this error can be caused by returning true from an action handler in a controller, causing the action to bubble.
和stacktrace:
EmberError@http://example.com/assets/vendor-952b195e45ab9682c02f1fabba312c19.js:25705:26
triggerEvent@http://example.com/assets/vendor-952b195e45ab9682c02f1fabba312c19.js:38985:44
trigger@http://example.com/assets/vendor-952b195e45ab9682c02f1fabba312c19.js:64971:26
trigger@http://example.com/assets/vendor-952b195e45ab9682c02f1fabba312c19.js:63740:21
send@http://example.com/assets/vendor-952b195e45ab9682c02f1fabba312c19.js:38468:45
send@http://example.com/assets/vendor-952b195e45ab9682c02f1fabba312c19.js:42710:26
runRegisteredAction@http://example.com/assets/vendor-952b195e45ab9682c02f1fabba312c19.js:33277:30
run@http://example.com/assets/vendor-952b195e45ab9682c02f1fabba312c19.js:10765:30
run@http://example.com/assets/vendor-952b195e45ab9682c02f1fabba312c19.js:30030:32
handler@http://example.com/assets/vendor-952b195e45ab9682c02f1fabba312c19.js:33269:39
http://example.com/assets/vendor-952b195e45ab9682c02f1fabba312c19.js:55210:34
dispatch@http://example.com/assets/vendor-952b195e45ab9682c02f1fabba312c19.js:4872:14
handle@http://example.com/assets/vendor-952b195e45ab9682c02f1fabba312c19.js:4540:33
错误消息的含义很明确,但我想知道是否有方法可以轻松识别未处理back
操作的位置。