**** BEGIN LOGGING AT Sat Oct 11 03:00:00 2014 Oct 11 05:33:05 Hey, in a JavaScript service, when returning a failing, does anyone know how to control the errorText returned? Oct 11 05:36:05 what you just said Oct 11 05:36:07 made no sense Oct 11 05:36:17 throw Exception(“message") Oct 11 05:36:20 but exception is an object Oct 11 05:36:22 new Exception() Oct 11 05:36:24 you can throw anythig Oct 11 05:36:40 nvm thats not javascript Oct 11 05:36:43 throw “this shxt" Oct 11 05:36:48 throw whatever object you want Oct 11 05:37:29 i went off before realizing this was in #webos-ports if you are referring to a special type of service in webos lmk Oct 11 05:38:00 my mistake ill still do my best to help. Oct 11 05:38:34 throw “any object, string, w/e” is the generic way to throw a textual error in js Oct 11 05:45:26 This is in a JavaScript service, returning a value over the PalmBus Oct 11 05:46:34 The service run method gets passed a future, and you can set future.exception to have the service call fail. Oct 11 05:47:00 Typically, the expection will have a message property. Oct 11 05:47:32 yea so its gotta be a custom object Oct 11 05:47:41 im on the gh right now trying to find it Oct 11 05:49:26 It appears, that the PalmBus constructs an object with an errorText property “No errorCode; Error: ” Oct 11 05:49:53 im having a hard time finding where palmbus even lives in the git Oct 11 05:50:09 luna-service2 Oct 11 05:50:16 maybe Oct 11 05:50:19 … except when the errorText message is exactly the same as the exception.message. Oct 11 05:52:10 apparently that part does live in c++ Oct 11 05:54:04 returnValue: false Oct 11 05:54:08 in there right Oct 11 05:55:05 https://github.com/openwebos/luna-service2/blob/3f07930b9da204d2056d643f698f72d0e90883ad/files/schema/generalResponse.schema Oct 11 05:55:11 make sure it conforms to that Oct 11 05:55:16 apparently its validated Oct 11 05:56:21 Hmm, I think I’ve followed that. Oct 11 05:56:57 i bet, damn Oct 11 05:57:29 Though, hmm, some system services return an errorCode that’s a string, not an integer as the schema says. Oct 11 05:57:44 which made me wonder what it returns to Oct 11 05:57:55 if its not maybe a bug in palmbus itself Oct 11 05:58:42 Not so much bugs as unspecified behavior in some cases. Oct 11 06:00:46 JavaScript services were never properly documented. Oct 11 06:02:08 which i could say i haven’t had a webos phone in ages Oct 11 06:02:15 got the damned pixi without wifi support Oct 11 06:16:47 Okay, it looks like the inconsistence I was seeing is because of how my app functions. Oct 11 06:38:08 Dang, if you set future.exception to an Error with the non-standard property errorCode set to a string, the PalmBus call will return erroCode to that string, and the errorText also. Oct 11 06:38:18 That is so non-intuitive. Oct 11 09:19:07 morning Oct 11 09:22:24 DougReeder: the magic for node.js services happens here: https://github.com/webOS-ports/mojoservice-frameworks/blob/master/mojoservice/javascript/controller_command.js#L135 Oct 11 09:23:12 ah.. he's gone already. Hate it when I read some questions I could answer in the backlog, but can't do anymore. :( Oct 11 20:20:26 I created a wiki page at http://www.webos-internals.org/wiki/JavaScript_Services Oct 11 20:20:50 When my toddler needs less attention, I’ll add the errorCode weirdness Oct 11 22:10:13 so.. umm.. after discovering that the nexus 5 has wireless qi and an appropriate magnet setup, i'm going to see about the possibilities of either adding magnets to cheap Qi chargers, or making Touchstones work with Qi. Oct 11 22:13:21 \o\ Oct 11 22:13:33 /o/ Oct 11 22:13:37 \o/ Oct 11 22:20:52 also, just downgraded the lady from the Veer to my Gnexus. :| since I never got that touchstone mod working again, if I'm successful at converting a Touchstone to Qi, then I'll just get a Qi coil and do it that way Oct 11 22:21:42 metal discs from Pixi, Qi coil, Qi modded touchstone, or a Qi pad with rare earth magnets. Oct 12 00:17:58 DougReeder: the magic for node.js services happens here: https://github.com/webOS-ports/mojoservice-frameworks/blob/master/mojoservice/javascript/controller_command.js#L135 Oct 12 00:19:27 for some reason I can not edit your wiki page.. hm. Oct 12 02:34:34 Garfonso , you’re right - the returned values are not quite so weird as I thought. **** ENDING LOGGING AT Sun Oct 12 02:59:59 2014