Skip to content

Commit e945c2a

Browse files
committed
Improve CLI error messages for git repository info
1 parent 3a75dee commit e945c2a

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/labels/cli.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,9 @@ def default_owner(labels_context: LabelsContext) -> str:
6363
if labels_context.repository is None:
6464
repository = utils.load_repository_info()
6565
if repository is None:
66-
raise click.BadParameter("Unable to load repository information.")
66+
raise click.BadParameter(
67+
"Unable to read respository owner from git remote URL."
68+
)
6769
labels_context.repository = repository
6870
return labels_context.repository.owner
6971

@@ -74,7 +76,9 @@ def default_repo(labels_context: LabelsContext) -> str:
7476
if labels_context.repository is None:
7577
repository = utils.load_repository_info()
7678
if repository is None:
77-
raise click.BadParameter("Unable to load repository information.")
79+
raise click.BadParameter(
80+
"Unable to read repository name from git remote URL."
81+
)
7882
labels_context.repository = repository
7983
return labels_context.repository.name
8084

0 commit comments

Comments
 (0)