openlibraryenvironment/gokb

please describe interface for reporting errors

Closed this issue · 1 comments

In #261 I described an error occurred during profile update. The response was this error object:

errors: Array(1)
0:
user:
baddata: "curatoryGroupIds"
code: null
message: "user test3 is not allowed to change property curatoryGroupIds of user test3"

It seems that a response can answer with several errors found. It starts with user, should be profile?

A short description of the error response would be helpful.

the error map is supposed to follow the rules outlined by Moritz:

errors: [
    wrongPropertyName: [
        message: "errorText",
        code: errorIndex,
        baddata: wrongValueOfProperty
    ],
    otherWrongPropertyName: [
         ...
]

the top-level array is somehow introduced by mistake - I'll change that.

Since there are no errorCodes for localized messages defined yet, this field is left blank.