Error Responses to a RAD Request
For non-fatal errors, the server responds with information about the issue. The basic JSON structure of an error response is as follows:
{ "status": text-of-the-RAD error, "payload": payload }
In case of a HTTP 503
error, the value is defined and returned by the RAD module that is mentioned in the request. For all other errors, the payload value has the following format:
{ "Message": description-of-error, "HTTP Method": ("HEAD"|"GET"|"POST"|"PUT"|"DELETE"), "URI": full-URI-with-all-query-parameters, "RAD Operation": ("INVOKE"|"GETATTR"|"SETATTR"|"LOOKUP"|"LIST"|null), "Request payload": { Arguments provided by the client }, "Method": name of a method for INVOKE operation, "Attribute": name of an attribute/property for GETATTR, SETATTR ops, "Pattern": URI translated to RAD list pattern for LIST operation, "Name": URI translated to RAD name for LOOKUP operation, "Object": { URI translated to RAD object (any operation but LIST) "Name": name of a module, also known as domain "Interface": name of the interface, }, "Reference": RAD reference ID found in the special _rad_reference URIs, "Version": { Module version as found in the URI "Major": int, "Minor": int } }
Information that is not provided in the request or could not be decoded from the request is included in the response as a JSON null
.
Some of the examples of possible error messages are as follows:
Decoding request body as JSON failed: too big integer near '18446744073709551615'
Invalid (array) argument 'arg'='[true,false,true,false]' - element [0] - integer out of bounds (-2147483648, 2147483647)