Skip to content

fix(ifex_generator): remove unreachable return; use Exception not BaseException#167

Open
SoundMatt wants to merge 1 commit into
COVESA:masterfrom
SoundMatt:fix/ifex-generator-dead-code-and-base-exception
Open

fix(ifex_generator): remove unreachable return; use Exception not BaseException#167
SoundMatt wants to merge 1 commit into
COVESA:masterfrom
SoundMatt:fix/ifex-generator-dead-code-and-base-exception

Conversation

@SoundMatt

Copy link
Copy Markdown

Two small fixes in ifex_generator.py:

  1. return "" on the line immediately after raise GeneratorError(...) is unreachable dead code — removed.
  2. GeneratorError subclassed BaseException directly, which bypasses normal except Exception handlers upstream and makes the error unexpectedly hard to catch in calling code. Changed to subclass Exception instead.

…BaseException

Two small fixes in `_gen_with_default_template`:
1. `return ""` after a `raise` is unreachable dead code — removed.
2. `GeneratorError` inherits from `BaseException`, which bypasses
   normal `except Exception` handlers and makes the error hard to
   catch. Changed to `Exception`.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

Signed-off-by: Matt Jones <47545907+SoundMatt@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant