2.2.8.1.2 Verbose JSON Error Response

This section defines the structure of an error message represented in Verbose JSON, as specified in [RFC4627], that MUST be used in response payloads representing top-level errors, as specified in Error Response (section 2.2.8.1). For examples of errors that are represented in the preferred OData 3.0 JSON format, see [MS-ODATAJSON] section 2.1.28. For examples of errors that are defined in XML format, see XML Error Response (section 2.2.8.1.1).

The syntax of a top-level error using Verbose JSON (application/json;odata=verbose) is shown in the following ABNF Grammar for Top-level Error Payloads Formatted Using Verbose JSON listing.

 stdErrorVJson-RespBody   =  begin-object
                            quotation-mark "error" quotation-mark
                            name-seperator
                            begin-object
                            codeNVP
                            value-seperator messageNVP
                            [value-seperator innererrorNVP]
                            end-object
                            end-object
  
 codeNVP       =  quotation-mark "code" quotation-mark name-seperator string
    ; A data service defined string which serves as a
    ; sub status to the HTTP response code
  
 messageNVP  =  quotation-mark "message" quotation-mark name-seperator
                begin-object
                langNVP
                value-seperator valueNVP
                end-object
   ; Human readable description of the error
  
 langNVP       =  quotation-mark "lang" quotation-mark name-seperator string
   ;  A string as per [RFC4646]
  
 valueNVP      =  quotation-mark "value" quotation-mark name-seperator string
   ; Human readable message describing the error
  
 innererrorNVP = quotation-mark
                 "innererror" quotation-mark name-seperator object
  ; Data service defined debugging information
  ; This name/value pair should only be used in development environments.
  ; If present in a response from a production data service, it should not
  ; include system internal information in order to guard against information
  ; disclosure security concerns.
  
 begin-object  =  ; see [RFC4627] section 2
 end-object    =  ; see [RFC4627] section 2
 object        =  ; see [RFC4627] section 2.2
 string        =  ; see [RFC4627] section 2.5

Listing: ABNF Grammar for Top-level Error Payloads Formatted by Using Verbose JSON