lk-geimfari / mimesis

Mimesis is a robust data generator for Python that can produce a wide range of fake data in multiple languages.
https://mimesis.name
MIT License
4.44k stars 336 forks source link

More informative messages for NonEnumerableError #293

Closed lk-geimfari closed 6 years ago

lk-geimfari commented 6 years ago

Now it's looks like that:

>>> from mimesis import Cryptographic
>>> c = Cryptographic()
>>> c.hash(algorithm='nil')

Output:

Traceback (most recent call last):
  File "/home/user/Development/open_source/mimesis/.test.py", line 8, in <module>
    print(c.hash(algorithm='nil'))
  File "/home/user/Development/open_source/mimesis/mimesis/providers/cryptographic.py", line 41, in hash
    raise NonEnumerableError('Algorithm')
mimesis.exceptions.NonEnumerableError: You should use item of enum object «Algorithm» 
from module mimesis.enums

Any ideas?

sobolevn commented 6 years ago

Maybe list possible values?