Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify/prioritize http status code vs errorcode #1188

Closed
maxidorius opened this issue May 3, 2018 · 3 comments
Closed

Clarify/prioritize http status code vs errorcode #1188

maxidorius opened this issue May 3, 2018 · 3 comments
Assignees
Labels
clarification An area where the spec could do with being more explicit

Comments

@maxidorius
Copy link
Contributor

As seen by https://matrix.to/#/!XqBunHwQIXUiqCaoxq:matrix.org/%241525345332979375uwIJj:matrix.org some client rely on the error code string in the body instead of the returned status code. while some others rely on HTTP status code only.

HTTP status code and errorcode seem to be redundant piece of information at this point, so it would be good to take appropriate action depending on the intended purpose:

  • If status code always match a specific errorcode, then why have both? and if we must keep both, decide which one has priority and which one should be used by clients.
  • If they don't exactly match, or if the HTTP status code is a generic indication, then clarify the generic meaning of status codes in the spec (appendixes maybe)?
@richvdh
Copy link
Member

richvdh commented May 3, 2018

I couldn't agree more. I think in general we need both, because we want more expressiveness than is plausible from an HTTP status code alone; however this absolutely needs tidying up.

https://github.com/matrix-org/matrix-doc/issues/603 is related.

@njouanin
Copy link

njouanin commented May 3, 2018

The HTTP status code could also be added to the json error object, something like :
{ "errcode": "<error code>", "error": "<error message>", "http_status": 401 }

@turt2live turt2live added the clarification An area where the spec could do with being more explicit label Jul 19, 2018
@turt2live
Copy link
Member

I've labelled this as a clarification, although the OP is half suggestion half clarification.

@turt2live turt2live added this to To do: cross-cutting/misc (prioritized) in August 2018 r0 Aug 14, 2018
@turt2live turt2live moved this from To do: cross-cutting/misc (prioritized) to To do: client-server (prioritized) in August 2018 r0 Aug 30, 2018
@turt2live turt2live self-assigned this Aug 31, 2018
turt2live added a commit to turt2live/matrix-doc that referenced this issue Aug 31, 2018
This is based on observation and rough interpretation and may need additional review from people.

Fixes matrix-org#1188
@turt2live turt2live moved this from To do: client-server (prioritized) to In review (just the issues) in August 2018 r0 Aug 31, 2018
August 2018 r0 automation moved this from In review (just the issues) to Done (this list will be incomplete) Aug 31, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clarification An area where the spec could do with being more explicit
Projects
No open projects
August 2018 r0
  
Done (this list will be incomplete)
Development

No branches or pull requests

4 participants