Skip to content

SpiderFoot automates OSINT for threat intelligence and mapping your attack surface.

spiderfoot: 'except Exception' rather than 'BaseException'

Brendan Coles1adfb3be71b1
diff --git a/spiderfoot/db.py b/spiderfoot/db.py
index d73e7484..b5c1fe03 100644
--- a/spiderfoot/db.py
+++ b/spiderfoot/db.py
@@ -279,7 +279,7 @@ class SpiderFootDb:
# read and write to such a file.
try:
dbh = sqlite3.connect(database_path)
- except BaseException as e:
+ except Exception as e:
raise IOError(f"Error connecting to internal database {database_path}: {e}")
if dbh is None:
@@ -296,7 +296,7 @@ class SpiderFootDb:
try:
rx = re.compile(qry, re.IGNORECASE | re.DOTALL)
ret = rx.match(data)
- except BaseException:
+ except Exception:
return False
return ret is not None
@@ -311,7 +311,7 @@ class SpiderFootDb:
try:
self.create()
init = True
- except BaseException as e:
+ except Exception as e:
raise IOError(f"Tried to set up the SpiderFoot database schema, but failed: {e.args[0]}")
if init:
@@ -319,7 +319,7 @@ class SpiderFootDb:
try:
self.dbh.execute(qry)
self.conn.commit()
- except BaseException:
+ except Exception:
continue
self.conn.commit()
# self.conn.close()
diff --git a/spiderfoot/plugin.py b/spiderfoot/plugin.py
index 6255b198..13033755 100644
--- a/spiderfoot/plugin.py
+++ b/spiderfoot/plugin.py
@@ -224,7 +224,7 @@ class SpiderFootPlugin():
try:
listener.handleEvent(sfEvent)
- except BaseException as e:
+ except Exception as e:
self.log.exception(f"Module ({listener.__module__}) encountered an error: {e}")
def checkForStop(self):