microsoftgraph / msgraph-sdk-serviceissues

Tracks service issues for follow up.
5 stars 0 forks source link

Error codes do not match #7

Open nakamorichi opened 5 years ago

nakamorichi commented 5 years ago

Expected behavior

GraphError::isError should match error codes defined in enum GraphErrorCodes with the codes returned by the API.

Reference: https://docs.microsoft.com/en-us/graph/errors#code-property

Actual behavior

The method fails to match the error codes. For example, following request:

GET https://graph.microsoft.com/v1.0/me/calendars/<xxx>/events/<xxx>
SdkVersion : graph-java-v1.1.0
Authorization : Bearer <xxx>

404 : Not Found
HTTP/1.1 404 Not Found
Transfer-Encoding : chunked
Strict-Transport-Security : max-age=31536000
Cache-Control : private
x-ms-ags-diagnostic : {"ServerInfo":{"DataCenter":"Japan East","Slice":"SliceC","Ring":"5","ScaleUnit":"001","RoleInstance":"AGSFE_IN_0","ADSiteName":"JPE"}}
client-request-id : xxx
Duration : 92.646
request-id : xxx
Date : Thu, 14 Mar 2019 03:06:35 GMT
Content-Type : application/json
{
  "error": {
    "code": "ErrorItemNotFound",
    "message": "The specified object was not found in the store.",
    "innerError": {
      "request-id": "xxx",
      "date": "2019-03-14T03:06:36"
    }
  }
}

The above request tries to fetch a non-existent event from an existing calendar. The error code does not match with the code defined in the API reference (correct one would be itemNotFound) nor does it match with the one defined in the enum, ITEM_NOT_FOUND.

NakulSabharwal commented 5 years ago

@darrelmiller Can you point this issue to respective endpoint team ?

atulgpt commented 4 years ago

@NakulSabharwal any update on this? This is generating redundant error handling logic to get the error based on string search of the exception message.

petrhollayms commented 6 months ago

Thank you for reporting this issue. This appears to be an issue or limitation with the service APIs. Unfortunately, as the Microsoft Graph SDK team, we do not have ownership of the APIs that are causing you issues. We invite you to create a question about the service API to Microsoft Q&A and tagged with one of the [microsoft-graph-*] tags, that way it will get routed to the appropriate team for them to triage:

https://aka.ms/msgraphsupport or directly https://aka.ms/askgraph

For now, we will close the issue on our side but feel free to open it in the relevant repository if you think the issue is specific to SDK. Please let us know if this helps!

Note: We will close this repository on April 19, 2024.