Preserve client-error status for malformed upload bodies
For authenticated /api/upload requests with a non-form content type or malformed multipart body, request.formData() throws a TypeError before the existing Missing file field check runs. After this change, that non-PublicApiError flows into the default jsonError(error) path and is reported as a 500 Request failed. response, even though the caller sent an invalid upload request; this regresses the upload validation contract and can pollute server-error monitoring. Wrap formData() parse failures as a 400 while keeping real storage/database failures as 5xx.
Useful? React with 👍 / 👎.
Originally posted by @chatgpt-codex-connector[bot] in #153 (comment)
For authenticated
/api/uploadrequests with a non-form content type or malformed multipart body,request.formData()throws aTypeErrorbefore the existingMissing file fieldcheck runs. After this change, that non-PublicApiErrorflows into the defaultjsonError(error)path and is reported as a 500Request failed.response, even though the caller sent an invalid upload request; this regresses the upload validation contract and can pollute server-error monitoring. WrapformData()parse failures as a 400 while keeping real storage/database failures as 5xx.Useful? React with 👍 / 👎.
Originally posted by @chatgpt-codex-connector[bot] in #153 (comment)