зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1878021 - Print the messages for `InvalidRepoPath` and `MissingVCSTool` when `_get_repository_object` encounters those exceptions r=firefox-build-system-reviewers,glandium
This should make it easier for a user to troubleshoot the problem, instead of trying to decipher a subsequent exception from a function call being attempted on the `None` returned by this function. Differential Revision: https://phabricator.services.mozilla.com/D200496
This commit is contained in:
Родитель
b3798337bd
Коммит
d44d931081
|
@ -4,6 +4,7 @@
|
|||
|
||||
import abc
|
||||
import re
|
||||
import sys
|
||||
from pathlib import Path
|
||||
from threading import Thread
|
||||
|
||||
|
@ -187,7 +188,8 @@ def _delete_server_name(sentry_event, _):
|
|||
def _get_repository_object(topsrcdir: Path):
|
||||
try:
|
||||
return get_repository_object(str(topsrcdir))
|
||||
except (InvalidRepoPath, MissingVCSTool):
|
||||
except (InvalidRepoPath, MissingVCSTool) as e:
|
||||
print(f"Warning: {e}", file=sys.stderr)
|
||||
return None
|
||||
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче