function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
ArleneArlene 

Mobile SDK Hybrid Local app on iOS failing - how to get more detailed error?

I have a hybrid local app running with Mobile SDK 5.1.  Authentication works fine.  Selecting data works fine.  But when I try to update a record with force.update (using the new syntax with the Id in the object, not as a parameter), I'm getting a very generic 400 error.  All the obvious things look fine -- security, JSON format, etc.  I'm not so much looking for suggestions about the root cause, but could use some advice about how to get more information on the error.  JSON.stringify(error) only returns the URL constructed from the path and fields, and "error 400".  Any ideas about how to dig deeper?
SForceBeWithYouSForceBeWithYou
For some reason, ForceJS (the Javascript wrapper for the REST API used as part of the mobile SDK) has horribly non-descriptive errors when trying to perform inserts/updates.  I would recommend taking the same endpoint URL and POST body and trying that in the workbench (https://workbench.developerforce.com/login.php).  That's been my most reliable route to debugging what's going on with unsuccessful mobile SDK callouts.

Hope that helps!