Skip to content

Enhance ImportError handling in plugin.py#292

Open
gerbsen wants to merge 1 commit into
fralau:masterfrom
gerbsen:enhance-import-error-handling
Open

Enhance ImportError handling in plugin.py#292
gerbsen wants to merge 1 commit into
fralau:masterfrom
gerbsen:enhance-import-error-handling

Conversation

@gerbsen

@gerbsen gerbsen commented May 29, 2026

Copy link
Copy Markdown

I've just gone through some debugging nightmare. And wanted to share what help me. :)

Currently when the default main module exists but fails to import (e.g. due to a ModuleNotFoundError in one of its imports), the exception is silently swallowed and logged only as No default module 'main' found. This makes debugging extremely difficult as the real error is completely hidden.

The fix re-raises as a chained exception when the module file actually exists, preserving the original traceback while keeping the existing behaviour (silent skip) when the file genuinely doesn't exist.

Disclaimer: Claude 4.6 was used for debugging and fix creation

Improve error handling for local module import.
@fralau fralau added the please open issue A PR was created without the issue being discussed. label May 29, 2026
@fralau

fralau commented May 29, 2026

Copy link
Copy Markdown
Owner

Thanks a lot! Could I ask you to open an issue and attach this PR, so that the issue can be tracked?

@gerbsen

gerbsen commented May 29, 2026

Copy link
Copy Markdown
Author

resolves #285

It seems this has already been reported.

@fralau fralau linked an issue May 29, 2026 that may be closed by this pull request
@fralau fralau removed the please open issue A PR was created without the issue being discussed. label May 29, 2026
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.

No default module main found, if main.py contains import error

2 participants