From dcebe395ec4aebe4969e78220ae6afdcd78f47f9 Mon Sep 17 00:00:00 2001 From: Miguel Prieto Date: Wed, 4 Dec 2024 10:14:03 -0300 Subject: [PATCH] Error message on error while getting token suggest checking the config --- Conductor/Client/Authentication/TokenHandler.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Conductor/Client/Authentication/TokenHandler.cs b/Conductor/Client/Authentication/TokenHandler.cs index f0579e1..e743e29 100644 --- a/Conductor/Client/Authentication/TokenHandler.cs +++ b/Conductor/Client/Authentication/TokenHandler.cs @@ -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) {