JavaScript Services

From WebOS Internals
Revision as of 04:21, 12 October 2014 by Reeder.29 (talk | contribs) (returning values)
Jump to navigation Jump to search

Some notes to flesh out the primary documentation ==

== Node versions

  • webOS 2: node v0.2.3
  • webOS 3.0: node v0.4.12
  • webOS TV: ?
  • LuneOS (webOS 3.5): node v0.10.?


== Values returned over the PalmBus To return a success, set future.result to an object with the desired properties (where future is the future passed to the Command Assistant).

To return a failure, set future.exception to an object (typically some kind of Error). If you set the errorCode property of the object, that will be the errorCode returned over PalmBus, and the errorText will be copied from the message property. Otherwise, errorCode will be -9999 and errorText will be "MojoService: no errorCode supplied "+(reply.errorText||"")


While the Command Assistant run() method is called "inside" the future, it's not clear that you can compose the passed future with others.