mirror of
https://github.com/arcan1s/ahriman.git
synced 2025-04-24 23:37:18 +00:00
verbose multiarchitectureerror
This commit is contained in:
parent
e514740032
commit
f22c10c70d
@ -96,7 +96,7 @@ class Handler:
|
|||||||
# actually we do not have to spawn another process if it is single-process application, do we?
|
# actually we do not have to spawn another process if it is single-process application, do we?
|
||||||
if len(repositories) > 1:
|
if len(repositories) > 1:
|
||||||
if not cls.ALLOW_MULTI_ARCHITECTURE_RUN:
|
if not cls.ALLOW_MULTI_ARCHITECTURE_RUN:
|
||||||
raise MultipleArchitecturesError(args.command)
|
raise MultipleArchitecturesError(args.command, repositories)
|
||||||
|
|
||||||
with Pool(len(repositories)) as pool:
|
with Pool(len(repositories)) as pool:
|
||||||
result = pool.starmap(cls.call, [(args, repository_id) for repository_id in repositories])
|
result = pool.starmap(cls.call, [(args, repository_id) for repository_id in repositories])
|
||||||
|
@ -23,6 +23,8 @@ from collections.abc import Callable
|
|||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import Any, Self
|
from typing import Any, Self
|
||||||
|
|
||||||
|
from ahriman.models.repository_id import RepositoryId
|
||||||
|
|
||||||
|
|
||||||
class BuildError(RuntimeError):
|
class BuildError(RuntimeError):
|
||||||
"""
|
"""
|
||||||
@ -173,14 +175,18 @@ class MultipleArchitecturesError(ValueError):
|
|||||||
exception which will be raised if multiple architectures are not supported by the handler
|
exception which will be raised if multiple architectures are not supported by the handler
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, command: str) -> None:
|
def __init__(self, command: str, repositories: list[RepositoryId] | None = None) -> None:
|
||||||
"""
|
"""
|
||||||
default constructor
|
default constructor
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
command(str): command name which throws exception
|
command(str): command name which throws exception
|
||||||
|
repositories(list[RepositoryId] | None, optional): found repository list (Default value = None)
|
||||||
"""
|
"""
|
||||||
ValueError.__init__(self, f"Multiple architectures/repositories are not supported by subcommand {command}")
|
message = f"Multiple architectures/repositories are not supported by subcommand {command}"
|
||||||
|
if repositories is not None:
|
||||||
|
message += f", got {repositories}"
|
||||||
|
ValueError.__init__(self, message)
|
||||||
|
|
||||||
|
|
||||||
class OptionError(ValueError):
|
class OptionError(ValueError):
|
||||||
|
Loading…
Reference in New Issue
Block a user