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

Silent DataException in DataObject #88

Open
derrekbertrand opened this issue Dec 12, 2016 · 1 comment
Open

Silent DataException in DataObject #88

derrekbertrand opened this issue Dec 12, 2016 · 1 comment

Comments

@derrekbertrand
Copy link

https://github.com/nilportugues/php-json-api/blob/master/src/Server/Data/DataObject.php#L51

While testing some stuff out in the Laravel wrapper, I realized that you can trigger an exception here by setting the type to text instead of a JSON request. The data won't be filled out right, and the assert fails. Unfortunately, this line just eats the assertion, and happily lets it crash later.

@derrekbertrand
Copy link
Author

Look's like it is the Laravel wrapper's fault... partially. In non-debug mode, it dumps this message, but that doesn't really explain the error, just that your request setup is wrong.

Honestly, I think just commenting what that try-catch block does might help a lot.

{
  "errors": [
    {
      "status": 400,
      "title": "Bad Request",
      "detail": "Request could not be served."
    }
  ]
}

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

1 participant