API handling of error messages
FortiExtender now displays more informative messages about the success or failure of any CRUD operation, including any or all references to the messages.
The API payload either has the "details" property or comes without it at all. If there is the "details" property in the API payload, FortiExtender shows the "details" property or the "message" property; if there is any reference to the "mesage"/"details", it uses the "path" property. This applies to the entire FortiExtender product line.
Sample payload
Success: { "payload": {}/[], "error": { "code": "Success", "message": "The request has succeeded.", "path": "<The resource location that produced the error>" } } Error 1 without details: { "error": { "code": "MethodNotAllowed", "message": "The method is not allowed for the requested resource.", "path": "<The resource location that produced the error>" } Error 2 without details: `{ "error": { "code": "InvalidConfig", "message": "The configuration is invalid.", "details": "<details messages without path>", "path": "<The resource location that produced the error>" } }