Skip to content

fix(generator, generator_dbus): remove undefined filename variable from error message#174

Open
SoundMatt wants to merge 1 commit into
COVESA:masterfrom
SoundMatt:fix/generator-filename-nameerror
Open

fix(generator, generator_dbus): remove undefined filename variable from error message#174
SoundMatt wants to merge 1 commit into
COVESA:masterfrom
SoundMatt:fix/generator-filename-nameerror

Conversation

@SoundMatt

Copy link
Copy Markdown

Both generator.py and generator_dbus.py referenced filename in the except-clause error message:

print(f"ERROR: Read error resulting from {filename}: {e}")

filename is never defined in either function's scope — the parsed argument is args.input, and args is only assigned inside the try block. If the exception were actually raised, it would be immediately followed by a NameError, hiding the original error. Simplify the message to remove the undefined variable.

…om error messages

Both entrypoints referenced `filename` in an f-string error message,
but `filename` is never defined in scope at that point — `args.input`
is the correct name, and args is only set inside the try block.
Remove the interpolation to avoid masking the original error with a
`NameError`.

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