Hellor everybody!
When posting a too large file on my Xampp testserver I get an expected PostTooLargeException. I use custom exeption handling, so the error is formatted in json and I can display a custom message in german, that I then output in my vue component.
Handler.php in render function:
if ($exception instanceof PostTooLargeException) {
$message = ['errors' => ['file' => ['Datei ist zu groß.']]];
return response()->json($message, 413);
}
Now my problem: The response not only contains my json error object, but also a message I can't get rid of:
Warning: POST Content-Length of 48764135 bytes exceeds the limit of 10485760 bytes in Unknown on line 0
{"errors":{"file":["Datei ist zu gro\u00df."]}}
Where the "Warning: POST Content-Length..." is the unwanted part of the response.
Maybe someone knows whether Laravel puts this in the response or if I have to disable this somewhere in my Xampp config files. Anyway, any help is much appreciated!