Skip to content

Commit

Permalink
logger.error("An error occurred: {}", e.getMessage(), e);
Browse files Browse the repository at this point in the history
  • Loading branch information
grada84 committed Nov 4, 2024
1 parent a386de9 commit d54f4ce
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions src/main/java/net/lacnic/portal/auth/client/PortalWSClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,15 @@
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;

public class PortalWSClient {
private static final Logger logger = LoggerFactory.getLogger(PortalWSClient.class);

public static final String CONF_DIR = System.getProperty("jboss.server.config.dir");

Expand All @@ -36,7 +39,8 @@ public static TokenData getTokenData(String token) {
print(tokenData.toString());
return tokenData;
} catch (IOException e) {
e.printStackTrace();
logger.error("An error occurred: {}", e.getMessage(), e);

}
return new TokenData("Error en el cliente Java");
}
Expand All @@ -59,7 +63,8 @@ public static LoginData getLoginData(String username, String password) {

return dataLDAP;
} catch (IOException e) {
e.printStackTrace();
logger.error("An error occurred: {}", e.getMessage(), e);

}
return new LoginData("Error: verifique usuario y/o contraseña");
}
Expand Down Expand Up @@ -89,7 +94,8 @@ private static String readUrl(String urlString, String username, String password

return result.toString();
} catch (Exception e) {
e.printStackTrace();
logger.error("An error occurred: {}", e.getMessage(), e);

return null;
}
}
Expand All @@ -115,7 +121,8 @@ private static String readUrlToken(String urlString, String token) {

return result.toString();
} catch (Exception e) {
e.printStackTrace();
logger.error("An error occurred: {}", e.getMessage(), e);

return null;
}
}
Expand Down Expand Up @@ -158,7 +165,8 @@ public static LoginData getLoginDataTfa(String username, String password, String

return dataLDAP;
} catch (IOException e) {
e.printStackTrace();
logger.error("An error occurred: {}", e.getMessage(), e);

}
return new LoginData("Error ws nuevo");
}
Expand Down

0 comments on commit d54f4ce

Please sign in to comment.