Skip to content

Improve error handling #110

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

Closed
neomerx opened this issue Mar 12, 2016 · 0 comments
Closed

Improve error handling #110

neomerx opened this issue Mar 12, 2016 · 0 comments
Assignees
Milestone

Comments

@neomerx
Copy link
Owner

neomerx commented Mar 12, 2016

Practical usage of the lib shown design solutions for error handling could be improved.

Firstly, ExceptionThrowerInterface proved to be inefficient solution due to PHP specifics. When exception is thrown it contains trace to the code place where is was created but not where it was thrown. Therefore the first trace frame always points to ExceptionThrowerInterface implementation which makes the trace less easy to use. Proposed solution: throw native exceptions.

Secondly, having a JsonApiException and ErrorCollection classes appear to be very practical for error handling of all sorts (application logic, validation, etc). Such classes have to be added to the lib and used instead of ExceptionThrowerInterface.

Thirdly, RendererContainerInterface and RendererInterface with it's implementations are not used. Better solution could be build around JsonApiException + JSON API Errors. Should be removed from the lib.

@neomerx neomerx self-assigned this Mar 12, 2016
@neomerx neomerx added this to the 0.7.0 milestone Mar 12, 2016
neomerx added a commit that referenced this issue Mar 12, 2016
neomerx added a commit that referenced this issue Mar 12, 2016
neomerx added a commit that referenced this issue Mar 15, 2016
Add support for ErrorCollection to Encoder::encodeErrors()
@neomerx neomerx removed the fixed label Mar 15, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant