summaryrefslogtreecommitdiffstats
path: root/src/utils/sw_inventory.py
diff options
context:
space:
mode:
authorAlejandro Sirgo Rica <asirgo@soleta.eu>2024-04-03 10:54:51 +0200
committerAlejandro Sirgo Rica <asirgo@soleta.eu>2024-04-03 13:31:10 +0200
commitcbe7f8d49cb80e53948562c797c853b84f25c1e1 (patch)
treefe07a0c03e553d3fdb6e3a94514d88a36afa61dd /src/utils/sw_inventory.py
parentdfde363aa63ad3e7967da49f4ab599399b89e7f8 (diff)
src: use explicit exception types in except Exception blocks
Capture only the relevant exception types in each except block. The capture of the Exception type means hiding information for unhandled error cases, even for syntax errors in the codebase. Using a more fine grained exception filtering improves error traceability.
Diffstat (limited to 'src/utils/sw_inventory.py')
-rw-r--r--src/utils/sw_inventory.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/utils/sw_inventory.py b/src/utils/sw_inventory.py
index c7bb458..5f137f2 100644
--- a/src/utils/sw_inventory.py
+++ b/src/utils/sw_inventory.py
@@ -88,7 +88,7 @@ def _get_package_set_windows(hivepath):
h = hivex.Hivex(hivepath)
_fill_package_set_1(h, packages)
_fill_package_set_2(h, packages)
- except Exception as e:
+ except RuntimeError as e:
logging.error(f'Hivex was not able to operate over {hivepath}. Reported: {e}')
return packages