+

Search Tips | Advanced Search

For up-to-date product documentation, see the IBM MobileFirst Foundation Developer Center.


JSONStore errors

Learn about JSONStore errors.

Possible JSONStore error codes that are returned are listed in JSONStore error codes.


JavaScript

JSONStore uses an error object to return messages about the cause of failures.

When an error occurs during a JSONStore operation (for example the find, and add methods in the JSONStoreInstance class) an error object is returned. It provides information about the cause of the failure.


Example

Not all the key/value pairs are part of every error object. For example, the doc value is only available when the operation failed because of a document (for example the remove method in the JSONStoreInstance class) failed to remove a document.


Objective-C

All of the APIs that might fail take an error parameter that takes an address to an NSError object. If you don not want to be notified of errors, we can pass in nil. When an operation fails, the address is populated with an NSError, which has an error and some potential userInfo. The userInfo might contain extra details (for example, the document that caused the failure).


Example


Java

All of the Java™ API calls throw a certain exception, depending on the error that happened. We can either handle each exception separately, or we can catch JSONStoreException as an umbrella for all JSONStore exceptions.


Example

Parent topic: Troubleshooting JSONStore