Browse Source

Improve error if db is wrongly passed

Oz N Tiram 6 years ago
parent
commit
eb229364cc
1 changed files with 5 additions and 0 deletions
  1. 5 0
      pwman/data/factory.py

+ 5 - 0
pwman/data/factory.py

@@ -62,6 +62,11 @@ def check_db_version(dburi):
 
     dburi = urlparse(dburi)
     dbtype = dburi.scheme
+
+    if not dbtype:
+        print("Your URI seems incorrect ...")
+        sys.exit(0)
+
     try:
         cls = getattr(drivers, class_db_map[dbtype][0])
         ver = cls.check_db_version(class_db_map[dbtype][1](dburi))