Server errors

FormStore supports server.set/create returning a response object with error information in this format:

The combined list of fields in error (error object keys and field(s) in error_field) are fields that the server designated as being in error. Therefore, the updated value of each field in this list is NOT placed into the saved/known-good data in the model, like it normally happens at the end of a successful save().

Using error codes and client-side validation message formatting

For each property in error, instead of returning a String, the server can return an object in tv4 validation error format, i.e. with code and optional message property. When using MobxSchemaForm, such objects will be converted into messages using templates defined for the code in validationMessage property in that field's Form Field Metadata (or options.formDefaults passed to MobxSchemaForm).

Last updated