Skip to content

Fix date-time parse error handling and return 400 API response instead of 5xx#231

Merged
aracho1 merged 3 commits into
mainfrom
ac/fix-error-code
Jul 17, 2026
Merged

Fix date-time parse error handling and return 400 API response instead of 5xx#231
aracho1 merged 3 commits into
mainfrom
ac/fix-error-code

Conversation

@aracho1

@aracho1 aracho1 commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

What does this change?

  • Currently SaveArticlesController, when a client sends a date string that doesn't match the expected date/time format (ISO), the exception isn't caught anywhere in the request-handling chain so it propagates as an unhandled failure, crashing the lambda and causing API gateway to return 502 instead of the correct 400 error.
  • Update the controller to return 400 Bad Request directly on JSON deserialisation error.
  • Added unit tests

How has this change been tested?

Tested on CODE

CODE response
before image
after image

@aracho1
aracho1 force-pushed the ac/fix-error-code branch 2 times, most recently from 9e420fa to d654d2d Compare July 17, 2026 11:20
@aracho1 aracho1 added bug Something isn't working fix Departmental tracking: fix labels Jul 17, 2026
@aracho1
aracho1 force-pushed the ac/fix-error-code branch from d654d2d to 4a934a5 Compare July 17, 2026 11:55

@vlbee vlbee left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great find.

@aracho1
aracho1 merged commit 832a1b3 into main Jul 17, 2026
7 checks passed
@aracho1
aracho1 deleted the ac/fix-error-code branch July 17, 2026 13:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working fix Departmental tracking: fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants