Skip to content
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

Explain errors when request is not valid #64

Closed
ihorsamusenko opened this issue Apr 8, 2016 · 1 comment
Closed

Explain errors when request is not valid #64

ihorsamusenko opened this issue Apr 8, 2016 · 1 comment

Comments

@ihorsamusenko
Copy link

I ran into this time, for example I'm trying to create new entity sending POST request and put invalid json (or forgot put the json at all), then I got not really informative response

{
"@context": "/api/contexts/Error",
"@type": "Error",
"hydra:title": "An error occurred",
"hydra:description": "Syntax error",
"trace": [
{
"function": "cpostAction",
"class": "Dunglas\ApiBundle\Controller\ResourceController",
"type": "-\u003E",
"args": [
{
"attributes": {},
"request": {},
"query": {},
"server": {},
"files": {},
"cookies": {},
"headers": {}
}
]
},
{
"file": "/var/www/v3/app/bootstrap.php.cache",
"line": 3210,
"function": "call_user_func_array",
"args": [
[
{},
"cpostAction"
],
[
{
"attributes": {},
"request": {},
"query": {},
"server": {},
"files": {},
"cookies": {},
"headers": {}
}
]
]
},

It would be great to get message which explains me that the json is invalid.

@Simperfit
Copy link
Contributor

Errors are now better. But anyway you should be careful of the input

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

No branches or pull requests

2 participants