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

Catch missing non-optional controller parameter #35599

Conversation

ChristophWurst
Copy link
Member

@ChristophWurst ChristophWurst commented Dec 5, 2022

Resolves: n/a

Summary

Missing controller parameters cause an unhandled TypeError that results in a generic HTTP500. By reflecting on the params more clever we can determine if a parameter can be filled by its default value or if the request is invalid. A missing parameter in a JSON request, for example, could now be answered by a HTTP422 – unprocessible entity.

Before

Bildschirmfoto vom 2022-12-05 11-12-40

After

Bildschirmfoto vom 2022-12-14 17-55-20

TODO

  • Catch the error
  • Reply with a more specific response for JSON requests
  • Tests

Checklist

Missing controller parameters cause an unhandled TypeError that results
in a generic HTTP500. By reflecting on the params more clever we can
determine if a parameter can be filled by its default value or if the
request is invalid. A missing parameter in a JSON request, for example,
could now be answered by a HTTP422 – unprocessible entity.

Signed-off-by: Christoph Wurst <[email protected]>
@ChristophWurst ChristophWurst self-assigned this Dec 5, 2022
@ChristophWurst ChristophWurst added pending documentation This pull request needs an associated documentation update 2. developing Work in progress labels Dec 5, 2022
@szaimen szaimen added this to the Nextcloud 26 milestone Dec 5, 2022
@blizzz blizzz mentioned this pull request Feb 1, 2023
@skjnldsv skjnldsv mentioned this pull request Feb 23, 2023
@blizzz blizzz mentioned this pull request Mar 7, 2023
@blizzz blizzz modified the milestones: Nextcloud 26, Nextcloud 27 Mar 9, 2023
This was referenced May 3, 2023
@skjnldsv skjnldsv modified the milestones: Nextcloud 27, Nextcloud 28 May 9, 2023
@skjnldsv skjnldsv mentioned this pull request Nov 1, 2023
@ChristophWurst ChristophWurst removed this from the Nextcloud 28 milestone Nov 2, 2023
@ChristophWurst ChristophWurst added 0. Needs triage Pending check for reproducibility or if it fits our roadmap and removed 2. developing Work in progress labels Nov 2, 2023
@blizzz blizzz added this to the Nextcloud 29 milestone Nov 23, 2023
@skjnldsv skjnldsv added 2. developing Work in progress and removed 0. Needs triage Pending check for reproducibility or if it fits our roadmap labels Feb 21, 2024
@Altahrim Altahrim mentioned this pull request Mar 12, 2024
This was referenced Mar 14, 2024
@skjnldsv skjnldsv modified the milestones: Nextcloud 29, Nextcloud 30 Mar 28, 2024
@skjnldsv skjnldsv modified the milestones: Nextcloud 30, Nextcloud 31 Aug 14, 2024
@skjnldsv skjnldsv closed this Aug 14, 2024
@skjnldsv skjnldsv removed this from the Nextcloud 31 milestone Aug 14, 2024
@skjnldsv skjnldsv deleted the chore/catch-missing-non-optional-controller-parameter branch August 30, 2024 07:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2. developing Work in progress bug integration pending documentation This pull request needs an associated documentation update technical debt
Projects
Status: ☑️ Done
Development

Successfully merging this pull request may close these issues.

4 participants