aiorest icon indicating copy to clipboard operation
aiorest copied to clipboard

default error_reason messages

Open imbolc opened this issue 10 years ago • 3 comments

Maybe also use constants of http.client module like: RESTError('BAD_REQUEST') or RESTError(RESTError.BAD_REQUEST)?

imbolc avatar Aug 20 '14 04:08 imbolc

-1 for this.

error_reason message is not neccessarily the same as http response status reason. RESTError message parameter is there to be able to give more application/context specific error description (eg: RESTError(400, "required parameter 'user_id' is missing")). (aiohttp internally will set response status reason to 'Bad Request')

popravich avatar Sep 04 '14 11:09 popravich

Yes, but I think current empty message is not more informative :)

imbolc avatar Sep 08 '14 01:09 imbolc

Yeap, but that's the problem of a developer raising RESTError without message. I don't think that doubling the same message makes it more informative)

popravich avatar Sep 08 '14 06:09 popravich