From 87058c6ca5ec2c66d0850f1015de01ec6c0dd758 Mon Sep 17 00:00:00 2001 From: Jason Chang Date: Wed, 27 Sep 2023 11:34:43 -0700 Subject: 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 Reviewed-by: Gavin Mak Tested-by: Jason Chang --- git_command.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'git_command.py') diff --git a/git_command.py b/git_command.py index 71b464c6..fe1e48d6 100644 --- a/git_command.py +++ b/git_command.py @@ -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( -- cgit v1.2.3-54-g00ecf