Broker fixes for token refreshes and AccessDeniedException (#3161)

This commit is contained in:
Luke Tomlinson
2024-02-21 16:43:01 -05:00
committed by GitHub
parent 6603bfb74c
commit 3449d5fa52
3 changed files with 32 additions and 4 deletions

View File

@@ -110,9 +110,14 @@ namespace GitHub.Actions.RunService.WebApi
return result.Value;
}
// the only time we throw a `Forbidden` exception from Listener /messages is when the runner is
// disable_update and is too old to poll
if (result.StatusCode == HttpStatusCode.Forbidden)
{
throw new AccessDeniedException(result.Error);
throw new AccessDeniedException($"{result.Error} Runner version v{runnerVersion} is deprecated and cannot receive messages.")
{
ErrorCode = 1
};
}
throw new Exception($"Failed to get job message: {result.Error}");