Skip to content

Commit

Permalink
fix: raise import error from other one
Browse files Browse the repository at this point in the history
  • Loading branch information
maxim-v4s committed Dec 18, 2024
1 parent 151cc47 commit 4b8a055
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions qualibrate_composite/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,25 @@
app.include_router(base_router)

if _settings.runner.spawn:
from qualibrate_runner.app import app as runner_app
try:
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."
) from ex

runner_app.add_middleware(RunnerAuthMiddleware)
app.mount("/execution", runner_app, name="qualibrate_runner")

if _settings.app.spawn:
from qualibrate_app.app import app as qualibrate_app_app
try:
from qualibrate_app.app import app as qualibrate_app_app
except ImportError as ex:
raise ImportError(
"Can't import qualibrate_app instance. "
"Check that you have installed it."
) from ex

qualibrate_app_app.add_middleware(QualibrateAppAuthMiddleware)
app.mount("/", qualibrate_app_app, name="qualibrate_runner")
Expand Down

0 comments on commit 4b8a055

Please sign in to comment.