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

Improve request error responses to provide better error reporting #4452

Open
fgalan opened this issue Dec 13, 2023 · 1 comment
Open

Improve request error responses to provide better error reporting #4452

fgalan opened this issue Dec 13, 2023 · 1 comment
Labels

Comments

@fgalan
Copy link
Member

fgalan commented Dec 13, 2023

PR #4447 (issue #3499) improves update request error responses to provide a more accurate information regarding full/partial success, including information in description about the exact items that are failing (e.g. whole entities, specific attributes in particular entities, etc).

See the modifications to orion-api.md in that PR to know how it works.

However, the current mechanism could be considered somehow complex and some simplifications has been proposed. In particular:

  • Return always the same response code, no matter if the operation was full successful, full failure or partial success/fail. That code would be 200 OK.
  • Include detail in the response payload about the result of the request. Note that currently we include that information in description (e.g. "description": "do not exist: E/T - [ C, D ], G/T [entity itself]") which is human oriented. A formal format (i.e. a JSON multi-level object) should be defined.

Backward compatibility considerations should be taken into account. For instance, existing clients current error processing logic probably is just checking the HTTP response code, so if code != 2xx they know there is an error. If know all times we return 200 OK, these clients will break.

@fgalan fgalan added the backlog label Dec 13, 2023
@fgalan
Copy link
Member Author

fgalan commented Dec 13, 2023

For instance, existing clients current error processing logic probably is just checking the HTTP response code, so if code != 2xx they know there is an error. If know all times we return 200 OK, these clients will break.

In that case, the client will need to inspect the response payload to know if an error occurs.

In some way, it remembers how NGSIv1 worked (in NGSIv1 200 OK was returned at HTTP level and the actual error was in the internal StatusCode in the payload)... and that's not good :)

@fgalan fgalan changed the title Improve erquest error responses to provide better error reporting Improve request error responses to provide better error reporting Dec 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant