Skip to content

Commit

Permalink
Switch from InnerException to ErrorCode on disableupdate check (#2718)
Browse files Browse the repository at this point in the history
  • Loading branch information
nikola-jokic committed Aug 10, 2023
1 parent b882f66 commit 6680a3b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Runner.Listener/BrokerMessageListener.cs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public async Task<TaskAgentMessage> GetNextMessageAsync(CancellationToken token)
Trace.Info("Runner OAuth token has been revoked. Unable to pull message.");
throw;
}
catch (AccessDeniedException e) when (e.InnerException is InvalidTaskAgentVersionException)
catch (AccessDeniedException e) when (e.ErrorCode == 1)
{
throw;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Runner.Listener/MessageListener.cs
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ public async Task<TaskAgentMessage> GetNextMessageAsync(CancellationToken token)
_accessTokenRevoked = true;
throw;
}
catch (AccessDeniedException e) when (e.InnerException is InvalidTaskAgentVersionException)
catch (AccessDeniedException e) when (e.ErrorCode == 1)
{
throw;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Runner.Listener/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ private async static Task<int> MainAsync(IHostContext context, string[] args)
}

}
catch (AccessDeniedException e) when (e.InnerException is InvalidTaskAgentVersionException)
catch (AccessDeniedException e) when (e.ErrorCode == 1)
{
terminal.WriteError($"An error occured: {e.Message}");
trace.Error(e);
Expand Down

0 comments on commit 6680a3b

Please sign in to comment.