Skip to content

Be more verbose on import errors #18

@ramnes

Description

@ramnes

Trying to run our README's example without PyMongo installed throws:

Traceback (most recent call last):
  File "run.py", line 2, in <module>
    from flask_stupe import paginate, schema_required
ImportError: cannot import name 'paginate'

This error is completely normal, because we only expose things that are usable based on the different modules available. But it's not very developer-friendly and an error message explaining that paginate is not available because pymongo isn't installed would be much better.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions