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

fix(server): diff upload and download can handle JSON parsing errors #3759

Merged
merged 1 commit into from
Jan 3, 2025

Conversation

iainsproat
Copy link
Contributor

@iainsproat iainsproat commented Jan 2, 2025

Description & motivation

Previously, a 500 error was returned on invalid user input. This change returns 400 error with helpful error message to guide the user towards a fix.

Error identified via fuzz testing.

Changes:

  • test for error case provided
  • handling of JSON parsing made more robust and correct error status code returned
  • unrelated test, but which relied on this endpoint, amended to expect the updated status code

To-do before merge:

Screenshots:

Validation of changes:

Checklist:

  • My pull request follows the guidelines in the Contributing guide?
  • My pull request does not duplicate any other open Pull Requests for the same update/change?
  • My commits are related to the pull request and do not amend unrelated code or documentation.
  • My code follows a similar style to existing code.
  • I have added appropriate tests.
  • I have updated or added relevant documentation.

References

@iainsproat iainsproat requested a review from fabis94 January 2, 2025 17:23
@iainsproat iainsproat marked this pull request as ready for review January 2, 2025 17:23
@iainsproat iainsproat requested a review from alemagio January 2, 2025 17:23
@iainsproat iainsproat merged commit ce9f154 into main Jan 3, 2025
26 of 28 checks passed
@iainsproat iainsproat deleted the iain/improve-error-handling-api-diff branch January 3, 2025 07:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants