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

API Response codes and error handling #687

Open
donquixote opened this issue Jan 25, 2023 · 1 comment
Open

API Response codes and error handling #687

donquixote opened this issue Jan 25, 2023 · 1 comment
Assignees
Labels
api Modification linked to internal or external call to the application minor bug Should be treated after Major and Important bugs

Comments

@donquixote
Copy link

Hello,
when an API request fails, currently the response is just a "500 Internal Server Error" with html body.
This happens e.g. when I try to create a workspace with a group id that is already used by another workspace.

Alternatives:

  • To align with Nextcloud core or apps, there should be a nested response structure like {ocs: {meta: {statuscode: ***, message: "Id already occupied", status: "failure"}, data: {}}}. The actual http response code would be just 200.
  • Alternatively, to behave more like some other APIs, there could be a response code and message more specific than "500 Internal Server Error".
@zak39 zak39 self-assigned this Aug 4, 2023
@zak39 zak39 added the minor bug Should be treated after Major and Important bugs label Aug 4, 2023
@zak39
Copy link
Collaborator

zak39 commented Aug 4, 2023

Hi @donquixote

Thank you for your feedbacks 👍

About the OCS model, we are studying the structure of ours API/Rest and determine whether it is suitable for our case.

Alternatively, to behave more like some other APIs, there could be a response code and message more specific than "500 Internal Server Error".

I think we fixed this issue. I keep your issue under your hat if I will meet this error type.

@zak39 zak39 added the api Modification linked to internal or external call to the application label Aug 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api Modification linked to internal or external call to the application minor bug Should be treated after Major and Important bugs
Projects
None yet
Development

No branches or pull requests

2 participants