mirror of
https://gerrit.googlesource.com/git-repo
synced 2025-06-26 20:17:52 +00:00
Track expected git errors in logs
Sometimes it is expected that a GitCommand executed in repo fails. In such cases indicate in trace logs that the error was expected. Bug: b/293344017 Change-Id: If137fae9ef9769258246f5b4494e070345db4a71 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/387714 Commit-Queue: Jason Chang <jasonnc@google.com> Reviewed-by: Gavin Mak <gavinmak@google.com> Tested-by: Jason Chang <jasonnc@google.com>
This commit is contained in:
@ -286,6 +286,7 @@ class GitCommand(object):
|
||||
objdir=None,
|
||||
verify_command=False,
|
||||
add_event_log=True,
|
||||
log_as_error=True,
|
||||
):
|
||||
if project:
|
||||
if not cwd:
|
||||
@ -362,6 +363,7 @@ class GitCommand(object):
|
||||
"ReturnCode": str(e.git_rc)
|
||||
if e.git_rc is not None
|
||||
else None,
|
||||
"IsError": log_as_error,
|
||||
}
|
||||
)
|
||||
event_log.ErrorEvent(
|
||||
|
Reference in New Issue
Block a user