Restful icon indicating copy to clipboard operation
Restful copied to clipboard

Application\Responses\ErrorResponse

Open MartinMystikJonas opened this issue 10 years ago • 4 comments

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?

MartinMystikJonas avatar Jun 30 '14 15:06 MartinMystikJonas

This seems to be a great idea. It could be really useful to distinguish between normal and error response.

drahak avatar Jul 01 '14 14:07 drahak

Ok I will prepare PR

MartinMystikJonas avatar Jul 01 '14 15:07 MartinMystikJonas

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?

MartinMystikJonas avatar Jul 02 '14 11:07 MartinMystikJonas

Yes, its is. The $code parameter of sendResource is only used for sending errors.

drahak avatar Jul 02 '14 13:07 drahak