microsoft-graph-explorer-v4 icon indicating copy to clipboard operation
microsoft-graph-explorer-v4 copied to clipboard

InternalServerError on GET /places/microsoft.graph.room

Open Avada-Kedavra opened this issue 3 years ago • 6 comments

Describe the bug I understand GET /places/microsoft.graph.room isn't meant to be used for a personal account, but it shouldn't throw an InternalServerError in any case. This makes error handling on the client side difficult because we can't tell whether it's because of personal account or an actual issue on Microsoft Graph server.

To Reproduce Steps to reproduce the behavior:

  1. Make a GET request to https://graph.microsoft.com/v1.0/places/microsoft.graph.room while signed in as a personal account
  2. Server responds with InternalServerError

Expected behavior Since this is an issue from the client side, appropriate response would be something like 400 or 404, definitely not 500.

Screenshots Screenshot 2022-07-19 at 11 12 10

Desktop (please complete the following information):

  • OS: MacOS (12.3.1)
  • Browser: Chrome
  • Version: 103.0.5060.114

Avada-Kedavra avatar Jul 19 '22 10:07 Avada-Kedavra

Hey @Avada-Kedavra, We surface the errors that come from the API, it's not really an issue from the client side.

ElinorW avatar Jul 21 '22 09:07 ElinorW

Hey @Avada-Kedavra, We surface the errors that come from the API, it's not really an issue from the client side.

Hi @ElinorW! Sorry, let me clarify further. Since this API is not meant to be used by a personal account (as Places.Read.All permission isn't supported for personal account), it is a "bad request" from the client side. The best way to make the client know, in my opinion, would be to respond with an appropriate error.

If the client sees internal server error, it's likely to retry until a 20x or 40x response is received. Does that help?

Avada-Kedavra avatar Jul 21 '22 10:07 Avada-Kedavra

Hey @Avada-Kedavra, Yes, your clarification definitely helps. It seems that the API returns a 500 in cases where the permissions aren't supported for a personal account. At Graph Explorer we try not to mask the API responses because there could be cases where there is actually a server issue and we report it as a 400 or something which would be wrong.

I will escalate this with the team as it may require further discussion.

ElinorW avatar Aug 15 '22 16:08 ElinorW

@Avada-Kedavra, actually upon further reading... I've learnt that permission errors do result in a 500 response and I believe this is the correct error returned.

ElinorW avatar Aug 15 '22 16:08 ElinorW

@ElinorW We should never return a 5XX intentionally. As @Avada-Kedavra said, this should be a 400 or 404 error.

darrelmiller avatar Aug 16 '22 14:08 darrelmiller

@darrelmiller okay, just to clarify, Graph Explorer should mask the 500 as a 400 or 404? Or should Graph API update its status codes?

ElinorW avatar Aug 16 '22 16:08 ElinorW

@ElinorW GE should always return the status code returned by Graph so that the developer experience is uniform across any app/tool that they might be using to access Graph

adhiambovivian avatar Dec 13 '22 11:12 adhiambovivian

@adhiambovivian , in that case Graph Explorer does return the status code returned by Graph

ElinorW avatar Jan 12 '23 11:01 ElinorW

I shall be closing this as the responses returned are by design

ElinorW avatar Jan 16 '23 08:01 ElinorW