Activity log for bug #1130755

Date Who What changed Old value New value Message
2013-02-20 16:36:08 Manuel Cerón bug added bug
2013-02-20 16:36:32 Manuel Cerón summary Don't raise ImportError when the scheme is unsupported ImportError when the scheme is unsupported is misleading
2013-02-20 16:38:05 Manuel Cerón description If you use an unsupported scheme in a connection string, for example: >>> from storm.locals import * >>> database = create_database("postgresql://myhost.example.com:5432/mydb") You get an error like this one: Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/srv/test.fluidinfo.com/20130220-1556/fluidinfo/src/storm/storm/database.py", line 546, in create_database 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 the 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. If you use an unsupported scheme in a connection string, for example: >>> from storm.locals import * >>> database = create_database("postgresql://myhost.example.com:5432/mydb") You get an error like this one: Traceback (most recent call last):   File "<stdin>", line 1, in <module>   File "/srv/test.fluidinfo.com/20130220-1556/fluidinfo/src/storm/storm/database.py", line 546, in create_database     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.