Skip to content

Commit

Permalink
fix: Make pre-requisite check failure as non-unexpected
Browse files Browse the repository at this point in the history
  • Loading branch information
achimnol committed Nov 10, 2023
1 parent 84688ba commit 1463445
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/ai/backend/install/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

from . import __version__
from .context import DevContext, PackageContext, current_log
from .types import CliArgs, DistInfo, InstallModes
from .types import CliArgs, DistInfo, InstallModes, PrerequisiteError

top_tasks: WeakSet[asyncio.Task] = WeakSet()

Expand Down Expand Up @@ -69,6 +69,9 @@ async def install(self, dist_info: DistInfo) -> None:
_log.write(Text.from_markup("[red]Interrupted!"))
await asyncio.sleep(1)
raise
except PrerequisiteError as e:
_log.write(Text.from_markup("[red]:warning: A prerequisite check has failed."))
_log.write(e)
except Exception as e:
_log.write(Text.from_markup("[red]:warning: Unexpected error!"))
_log.write(e)
Expand Down Expand Up @@ -120,6 +123,9 @@ async def install(self, dist_info: DistInfo) -> None:
_log.write(Text.from_markup("[red]Interrupted!"))
await asyncio.sleep(1)
raise
except PrerequisiteError as e:
_log.write(Text.from_markup("[red]:warning: A prerequisite check has failed."))
_log.write(e)
except Exception as e:
_log.write(Text.from_markup("[red]:warning: Unexpected error!"))
_log.write(e)
Expand Down

0 comments on commit 1463445

Please sign in to comment.