在 WebOS 中记录 onFailure inError
webOS 中的 onFailure
处理程序有一个参数 inError。我尝试使用: console.log("error: " + inError);
打印它,但结果只是: error: [object Object]*** (app/assistants/main -assistant.js:26)
,这没什么用。我怎样才能记录一些更有用的东西呢?
更新:
Ares 生成:alarm1Failure: function(inSender, inError) {}
。但是,错误包含在第一个对象的 errorText
属性中,第二个对象是请求
An onFailure
handler in webOS has an argument inError. I tried printing it using: console.log("error: " + inError);
, but the result is only: error: [object Object]*** (app/assistants/main-assistant.js:26)
, which isn't much use. How can I log something more useful instead?
Update:
Ares generates: alarm1Failure: function(inSender, inError) {}
. However, the error is contained as the errorText
property of the first object and the second object is the request
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我将使用交互式调试器:
http://ares.palm.com/AresDebug/
连接您的设备并运行您的应用程序。将您的应用程序名称放入“脚本过滤器”框中,然后单击“获取脚本”。
现在使用“可用脚本”下拉菜单来查找您的程序集。
您可以设置断点(单击左侧的行号)并使用左下窗格和“>”检查变量迅速的。
请务必使用 Chrome 或 Safari,因为它不适用于 IE。
还有一个记录器位于:
http://ares.palm.com/AresLog/
I would use the interactive debugger at:
http://ares.palm.com/AresDebug/
Connect your device and run your app. Put your app name in the 'Script Filter' box and click get scripts.
Now use the 'Available Scripts' pull down to find your assembly.
You can set breakpoints (click on line numbers to the left) and inspect variables using the lower left pane and '>' prompt.
Be sure to use Chrome or Safari as it will not work with IE.
There is also a logger at:
http://ares.palm.com/AresLog/
如果您不想使用调试器,那么您可能应该了解有关返回给您的
inError
对象的信息。在本例中,我假设onFailure
来自协议函数的回调,因此请尝试查看协议文档以了解错误对象应包含哪些信息。if you don't want to use the debugger, then you probably should know something about the
inError
object getting returned to you. In this case I assume theonFailure
comes from a Protocol function's callback, so try looking in the Protocol documentation to see what information the error object should contain.另外,对于任何日志记录目的,不要忘记非常有用的函数,
它将获取一个对象并返回一个 JSON 表示形式,您可以记录该表示形式,以便您可以立即查看所有属性。
Also for any logging purposes don't forget about the imensely useful function
It will take an object and return a JSON representation that you can log so you can see all the properties at once.