ImportError when the scheme is unsupported is misleading
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Storm |
New
|
Undecided
|
Unassigned |
Bug Description
If you use an unsupported scheme in a connection string, for example:
>>> from storm.locals import *
>>> database = create_
You get an error like this one:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/srv/test.
None, None, [""])
ImportError: No module named postgresql
Note that the correct scheme is "postgres" not "postgresql".
The ImportError is very very misleading. You might think that you're missing a dependency, and spend hours trying to figure out what's going on. That's what just happened to me. :)
It would be *much better* if you catch the ImportError and then raise a different exception with a nice message saying that the scheme is unsupported. Then typos like the one that I made could be fixed easily. That would improve the usability of the library.
I'm using Storm from trunk.
Thanks.
summary: |
- Don't raise ImportError when the scheme is unsupported + ImportError when the scheme is unsupported is misleading |
description: | updated |