如何调试“权限被拒绝”使用 Firefox Addon SDK 时出错
使用 Addon SDK 1.0 测试和调试扩展时,我有时会在调试输出窗口中注意到以下内容:
error: An exception occurred.
Traceback (most recent call last):
Error: Permission denied to access object
有没有办法获取更多信息?一些调用堆栈信息会很好。它还有助于了解哪个“对象”的访问被拒绝。
(我知道我可以在每个语句之前放置 console.debug()
调用,但我正在寻找一种更优雅的方式)
When testing and debugging an extension using Addon SDK 1.0 I'm sometimes noticing the following in the debug output window:
error: An exception occurred.
Traceback (most recent call last):
Error: Permission denied to access object
Is there a any way to obtain more information? Some call stack info would be nice. Also it'd help to know to which "object" the access has been denied.
(I know I can put console.debug()
calls before every statement but I'm looking for a more elegant way here)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
正如 Wladimir 指出的,这实际上是 Gecko 错误报告的缺陷。因此,要在不撒满
console.log()
的情况下对其进行调试,您必须使用 C++ 级别的调试器或识别并修复核心缺陷。 https://bugzilla.mozilla.org/show_bug.cgi?id=435025已经跟踪了很多可以改进错误消息的案例。As Wladimir pointed out, this is actually a deficiency in Gecko's error reporting. So to debug it without sprinkling
console.log()
all over, you'd have to either use a C++ level debugger or get the core deficiency identified and fixed. https://bugzilla.mozilla.org/show_bug.cgi?id=435025 already tracks quite a few cases where the error messages could be improved.