Raise RepoExitError in place of sys.exit
Bug: b/293344017
Change-Id: Icae4932b00e4068cba502a5ab4a0274fd7854d9d
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/382214
Reviewed-by: Gavin Mak <gavinmak@google.com>
Tested-by: Jason Chang <jasonnc@google.com>
Reviewed-by: Aravind Vasudevan <aravindvasudev@google.com>
Commit-Queue: Jason Chang <jasonnc@google.com>
diff --git a/error.py b/error.py
index ed4a90b..cee977f 100644
--- a/error.py
+++ b/error.py
@@ -56,6 +56,10 @@
self.error = error
+class SilentRepoExitError(RepoExitError):
+ """RepoExitError that should no include CLI logging of issue/issues."""
+
+
class ManifestParseError(RepoExitError):
"""Failed to parse the manifest file."""
@@ -125,6 +129,10 @@
return self.reason
+class InvalidArgumentsError(RepoExitError):
+ """Invalid command Arguments."""
+
+
class SyncError(RepoExitError):
"""Cannot sync repo."""