Switch from InnerException to ErrorCode on disableupdate check (#2718)

This commit is contained in:
Nikola Jokic
2023-08-10 16:27:42 +02:00
committed by GitHub
parent b882f6696a
commit 6680a3b142
3 changed files with 3 additions and 3 deletions

View File

@@ -97,7 +97,7 @@ namespace GitHub.Runner.Listener
Trace.Info("Runner OAuth token has been revoked. Unable to pull message."); Trace.Info("Runner OAuth token has been revoked. Unable to pull message.");
throw; throw;
} }
catch (AccessDeniedException e) when (e.InnerException is InvalidTaskAgentVersionException) catch (AccessDeniedException e) when (e.ErrorCode == 1)
{ {
throw; throw;
} }

View File

@@ -252,7 +252,7 @@ namespace GitHub.Runner.Listener
_accessTokenRevoked = true; _accessTokenRevoked = true;
throw; throw;
} }
catch (AccessDeniedException e) when (e.InnerException is InvalidTaskAgentVersionException) catch (AccessDeniedException e) when (e.ErrorCode == 1)
{ {
throw; throw;
} }

View File

@@ -138,7 +138,7 @@ namespace GitHub.Runner.Listener
} }
} }
catch (AccessDeniedException e) when (e.InnerException is InvalidTaskAgentVersionException) catch (AccessDeniedException e) when (e.ErrorCode == 1)
{ {
terminal.WriteError($"An error occured: {e.Message}"); terminal.WriteError($"An error occured: {e.Message}");
trace.Error(e); trace.Error(e);