-
Notifications
You must be signed in to change notification settings - Fork 109
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
Exception Handler always returns blank 500 internal server error #555
Comments
The issue seems to be resolved when I create a json-api-default.php config file. Is that right? I do have a custom default name added to the boot method of a service provider. As described here: https://laravel-json-api.readthedocs.io/en/latest/basics/api/ |
When you get the 500 internal server error, what's the exception that's being reported to your log file? |
You shouldn't have to create the default config if you're changing the name of the default API, so something is definitely not right if that's the case. It'd help if you could let me know the exception in the log file. |
My mistake, it looks like the default api name was not added to the right place. Thanks! |
I am having a similar issue but I am using the default api name. Whenever a validation rule that I have added fails it falls over with a 500 error. This is Laravel 8 and version 3. This is the error stack: #0 /var/www/html/webservices.brewers.co.uk/vendor/cloudcreativity/laravel-json-api/src/Http/Requests/ValidatedRequest.php(273): CloudCreativity\LaravelJsonApi\Exceptions\ValidationException::create(Object(CloudCreativity\LaravelJsonApi\Validation\Validator)) |
@brewers-dev-phil can you share your Exception handler and confirm you've followed the installation instructions for what needs adding to the exception handler? All the tests for validation exceptions are passing in Laravel 8, so I suspect it's something to do with your set up. |
Hello Chris, Had missed that - all sorted now. Apologies and thanks for pointing me in the right direction. |
No problem - glad you got it sorted! |
I'm using Laravel 8 with version 3.0. When I change the exception handler exactly as described in the docs (https://laravel-json-api.readthedocs.io/en/latest/installation/) all the errors in the application give a blank page with 500 internal server error.
I've done some digging and the functions isJsonApi() and renderJsonApi() from the HandlesErrors trait seems to be the problem. Looks like a bug? Or am I missing something here?
The text was updated successfully, but these errors were encountered: