Skip to content

Commit 70415aa

Browse files
committed
Add sanity check on DB path
The current error message is a bit cryptic
1 parent 97a16df commit 70415aa

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

analyzer/DBParser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def __init__(self, dbPath):
3232
argsAndReturnValue = self._sanitize_args_dict(plistlib.readPlistFromString(row[2].encode('utf-8')))))
3333
rowid += 1
3434
except sqlite3.Error as e:
35-
print "Fatal error: %s" % e
35+
#print "Fatal error: %s" % e
3636
raise
3737
finally:
3838
if SqlConn:

analyzer/introspy.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
__copyright__ = "Copyright 2013, iSEC Partners, Inc."
99

1010
from sys import argv
11+
import os
1112
from argparse import ArgumentParser
1213
from re import match
1314
from DBAnalyzer import DBAnalyzer
@@ -68,6 +69,10 @@ def main(argv):
6869

6970

7071
# Process the DB
72+
# Make sure it's there
73+
if not os.path.exists(db_path): # Nice race condition
74+
print 'Error: Could not find the DB file.'
75+
return
7176
analyzedDB = DBAnalyzer(db_path)
7277

7378

0 commit comments

Comments
 (0)