Skip to content

Latest commit

 

History

History
42 lines (32 loc) · 2.41 KB

ErrorContent.md

File metadata and controls

42 lines (32 loc) · 2.41 KB

Error Content

Objectives

  • Provide access to error information included in the response body of a 4XX or 5XX response.
  • Define standard class names for error scenarios.

Requirements

  • Match the specification as defined by the Microsoft API Guidelines for errors returned in API responses.
  • Service errors SHOULD be defined in a class named GraphServiceException or GraphServiceError depending on the platform.
  • Service errors SHOULD contain the response status code and response headers.
  • Client errors SHOULD be defined in a class named GraphClientException or GraphClientError depending on the platform.
  • Client and service errors should use common properties according to the Microsoft API Guidelines.

GraphServiceException or GraphServiceError MUST support all potential OData error properties. See Microsoft Graph error JSON for more information. The following is an example GraphServiceException response payload.

{
    "error": {
        "code": "BadRequest",
        "message": "Resource not found for the segment 'mef'.",
        "innerError": {
            "date": "2021-07-02T01:40:19",
            "request-id": "1a0ffbc0-086f-4e8f-93f9-bf99881c65f6",
            "client-request-id": "225aed2b-cf4a-d456-b313-16ab196c2364"
        }
    }
}

Reference service error implementations

Reference client error implementations