WebApps 2

Error handling

An error object from the data storage API consists of the following:

{
   dataStore: "datastorekey",
   type: "An error type",
   message: "An error message"
}

The following error types exist

Type

What went wrong?

validation_failed

Input arguments failed to validate. See the error message for more information

read_only

It is not possible to perform mutating operations when a data store is set to read-only

item_not_found

A non-existing key was used to retrieve data

item_property_count_exceeded

Too many properties on the retrieved item. See restrictions

illegal_method_call

Most likely was next() called on an exhausted search result iterator

unknown

An unknown error occurred. See the error message for more information

Restrictions

  • The data storage API is available in WebApps and RESTApps.
  • Data stored in a data store must be be JSON serializable
  • A data store record is restricted to a maximum of 50 top level properties
    • A record is the the value in a key-value data store or an item in a collection data store
    • If property count is exceeded, record will be unavailable. Properties can be removed by setting it to null
  • Top level property keys are restricted to a maximum of 100 characters
  • Property values are restricted to a maximum of 5000 characters
    • A value is the data stored on a top level property
  • Keys dsid and dstimestamp are populated by the API itself (i.e. never try to mutate/store data for such key since your data/value will be overwritten by the API).
    • Keys dsid and dstimestamp are internal values and may change at any time.
    • The values of dsid and dstimestamp should NOT be used as identifiers. They will change, for instance, if the website is exported and imported.
    • If there is a need for persistant keys or timestamps, for instance to connect posts in 2 separate datastores, set up custom fields as unique keys for this purpose.