Skip to content

default to JSON responses for exceptions#1162

Merged
tarrow merged 1 commit into
mainfrom
alwaysReturnJson
Jun 16, 2026
Merged

default to JSON responses for exceptions#1162
tarrow merged 1 commit into
mainfrom
alwaysReturnJson

Conversation

@tarrow

@tarrow tarrow commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Overwrite the default error handler in our custom handler to so it shouldReturnJson is always true.

This prevents http responses (and the confusing redirect) with ValidationExceptions

Bug: T429021

Overwrite the default error handler in our custom handler to so it
shouldReturnJson is always true.

This prevents http responses (and the confusing redirect) with
ValidationExceptions

Bug: T429021
@tarrow tarrow requested a review from deer-wmde June 15, 2026 16:10

@deer-wmde deer-wmde left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nice find! I love how clean this is

Can confirm it works locally:

$ curl -s --insecure "https://www.wbaas.dev/api/wiki?per_page=101" 
{"message":"The per page must not be greater than 100.","errors":{"per_page":["The per page must not be greater than 100."]}}

@tarrow tarrow merged commit 048bc66 into main Jun 16, 2026
5 checks passed
@tarrow tarrow deleted the alwaysReturnJson branch June 16, 2026 07:41
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