Skip to content

Commit

Permalink
Fix handling of non-existing inputs and other extractor errors
Browse files Browse the repository at this point in the history
spec._extractor() raises ExtractorError if and when an error occurs and
not an InvalidSpec, so handle this exception in the except clause.

This ensures that we give the expected error instead of a full
backtrace when specifying a non-existing file, for example.
  • Loading branch information
vadz committed Nov 7, 2024
1 parent f45f422 commit 6decccb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion abi3audit/_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
from abi3audit._audit import AuditError, AuditResult, audit
from abi3audit._extract import (
Extractor,
ExtractorError,
InvalidSpec,
PyPISpec,
SharedObjectSpec,
Expand Down Expand Up @@ -238,7 +239,7 @@ def main() -> None:
status.update(f"auditing {spec}")
try:
extractor = spec._extractor()
except InvalidSpec as e:
except ExtractorError as e:
console.log(f"[red]:thumbs_down: processing error: {e}")
sys.exit(1)

Expand Down

0 comments on commit 6decccb

Please sign in to comment.