Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Expand runner/core import errors #29

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

nulinspiratie
Copy link
Contributor

Currently if the import of runner/core fails, the traceback is shown but the actual error isn't shown. This PR fixes that.

@nulinspiratie nulinspiratie self-assigned this Jan 7, 2025
@nulinspiratie
Copy link
Contributor Author

@maxim-v4s can you review?

Copy link
Collaborator

@maxim-v4s maxim-v4s left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just note: It's a little strange that CI wasn't triggered.

In my POV it's a redundant to show original error. raise from contains all info about issue cause. If you think that really needed to have this then it's needed to fix next 2 comments.

uvicorn.run(
"qualibrate_composite.app:app", port=port, host=host, reload=reload
)
uvicorn.run("qualibrate_composite.app:app", port=port, host=host, reload=reload)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line too long.
80 symbols max with leading padding spaces.

@@ -39,8 +39,8 @@
from qualibrate_runner.app import app as runner_app
except ImportError as ex:
raise ImportError(
"Can't import qualibrate_runner instance. "
"Check that you have installed it."
f"Can't import qualibrate_runner instance. "
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

f should be used only before strings with templates.
So correct:

raise ImportError(
    "Can't import qualibrate_runner instance. "
    f"Check that you have installed it. Original error: {ex}"
)

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.

2 participants