trafaret_forked icon indicating copy to clipboard operation
trafaret_forked copied to clipboard

trafaret.DataError's method as_dict returns either string or dict

Open thenx opened this issue 7 years ago • 2 comments

Is that intended to be so or just some legacy code or smth? IMHO, it is:

  1. Misguiding
  2. Introduces necessity to validate and convert the result

Wouldn't it be better to always return dicts?

thenx avatar Jun 22 '17 11:06 thenx

Again this is a long time behaviour and definitely it need to be solved. Will think.

Deepwalker avatar Jul 17 '17 08:07 Deepwalker

This also results in aiohttp_admin's exceptions during passing validation errors to frontend in util.py and mongo_utils.py (lines with **exc.as_dict())

thenx avatar Jul 17 '17 09:07 thenx