Skip to content

Commit

Permalink
Error message on error while getting token suggest checking the config
Browse files Browse the repository at this point in the history
  • Loading branch information
jmigueprieto committed Dec 4, 2024
1 parent 0424189 commit dcebe39
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion Conductor/Client/Authentication/TokenHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,15 @@ private string GetTokenFromServer(OrkesAuthenticationSettings authenticationSett
{
try
{
return tokenClient.GenerateToken(tokenRequest)._token;
var token = tokenClient.GenerateToken(tokenRequest);
return token._token;
}
catch (ApiException e)
{
if (e.ErrorCode == 405 || e.ErrorCode == 404)
{
throw new Exception($"Error while getting authentication token. Is the config BasePath correct? {tokenClient.Configuration.BasePath}");
}
}
catch (Exception e)
{
Expand Down

0 comments on commit dcebe39

Please sign in to comment.