How to respond with an error message not specific to any field but whole record?

How to respond with an error message not specific to any field but whole record?

LeonKLeonK Posts: 13Questions: 5Answers: 1

something like { fieldErros:[], status: "your record is too strange!" }

This question has accepted answers - jump to:

Answers

  • LeonKLeonK Posts: 13Questions: 5Answers: 1
    edited December 2015

    also It would be right to work with result codes like

    HTTP/1.1 422 Unprocessable Entity
    

    Default for rails

  • allanallan Posts: 61,972Questions: 1Answers: 10,160 Site admin
    Answer ✓

    At the moment, for a 4xx error to work correctly with Editor you would need to use ajax as a function and make the $.ajax call yourself. Then call the success callback that the ajax option gives you when you get such an entry (assuming that it also returns valid JSON).

    I'll look into how this can be improved for future versions.

    Allan

  • LeonKLeonK Posts: 13Questions: 5Answers: 1

    And is there way to report "record error" instead of field error?

  • allanallan Posts: 61,972Questions: 1Answers: 10,160 Site admin
    Answer ✓

    Yes - there is an error property which can be used. It can be used for a form error.

    Regards,
    Allan

  • LeonKLeonK Posts: 13Questions: 5Answers: 1

    Thank you!

This discussion has been closed.