Skip to content

Improve error handling #110

@neomerx

Description

@neomerx

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.

Metadata

Metadata

Assignees

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions