You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The issue seems to be that neither ConflictException nor its parent classes have a constructor to actually do something with the "source" array, and the native constructor of Exception gets called which expects an integer as second argument (for the exception code).
I wouldn't mind fixing this in a PR but I'm unsure how you'd want to proceed this. Either ConflictException should also support the "source" argument (but I'm not sure what impact that would have on the rest of the library) or no source should be included when throwing it.
The text was updated successfully, but these errors were encountered:
Thanks for the detailed report. I think I want to fix this as part of some broader improvements to error handling (i.e. every type of exception should have the ability to have a source, not just Bad Request)
When we (accidentally) try to update a resource with a different id in the URL as in the body, we get the following PHP error:
Thrown here: https://github.com/tobyzerner/json-api-server/blob/main/src/Endpoint/Concerns/SavesData.php#L43-L45
This line was changed in June I see: 3bdac86#diff-4e1c4cc32773a07b137197237630335d71c60511db9adc163b51a8c4c54f0443L43-R45
The issue seems to be that neither
ConflictException
nor its parent classes have a constructor to actually do something with the "source" array, and the native constructor ofException
gets called which expects an integer as second argument (for the exception code).It does not occur for
BadRequestException
because that one does have a custom constructor: 3bdac86#diff-90e3070308e4f4b6b74f5bde2dc516df0f5eed0426e2777eea15f9bd867f7591I wouldn't mind fixing this in a PR but I'm unsure how you'd want to proceed this. Either
ConflictException
should also support the "source" argument (but I'm not sure what impact that would have on the rest of the library) or no source should be included when throwing it.The text was updated successfully, but these errors were encountered: