santiment / sanpy

Santiment API Python Client
MIT License
96 stars 29 forks source link

Invoking invalid queries about projects causes a cryptic error #31

Closed valo closed 6 years ago

valo commented 6 years ago

If you invoke san.get("projects/bla") you get a cryptic error:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/valentin/.pyenv/versions/3.6.3/lib/python3.6/site-packages/san/get.py", line 15, in get
    gql_query = get_gql_query(0, dataset, **kwargs)
  File "/Users/valentin/.pyenv/versions/3.6.3/lib/python3.6/site-packages/san/query.py", line 10, in get_gql_query
    )(idx, slug, **kwargs)
  File "/Users/valentin/.pyenv/versions/3.6.3/lib/python3.6/site-packages/san/sanbase_graphql.py", line 103, in projects
    raise SanError("Unknown project group: {}".format(slug))
NameError: name 'SanError' is not defined

We need to improve the error here.