Search code examples
webos

Logging an onFailure inError in WebOS


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


Solution

  • 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/