Restful
Restful copied to clipboard
Application\Responses\ErrorResponse
Another suggestion we would find useful is to create new class Application\Responses\ErrorResponse inherited from TextResponse which will represent be used for returning errors.
It will allows simplify testing if returned response is error or not.
What do you think? Should i prepare PR?
This seems to be a great idea. It could be really useful to distinguish between normal and error response.
Ok I will prepare PR
I', just working on ti and I have a question. Parameter $code of sendResource - is it used only for purposes of sending errors? Therefore if I do not call sendResource from SendErrorResource should it be ommited?
Yes, its is. The $code
parameter of sendResource is only used for sending errors.