Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/0.0.4.3 #41

Merged
merged 9 commits into from
Sep 6, 2019
Merged

Feature/0.0.4.3 #41

merged 9 commits into from
Sep 6, 2019

Conversation

JuanGamezSW
Copy link
Contributor

New: Servicios de administración de certificados

BugFix: Ahora no se tiene un exception cuando el servidor regresa un error 500, en su lugar muestra el texto asociado al HTTP status code y el texto obtenido en la respuesta.

@@ -64,7 +64,7 @@ public IResponse sendRequest(IRequest request) throws GeneralException, AuthExce
client.close();
responseB.close();
System.out.println(responseString);
if(!responseString.isEmpty()) {
if(!responseString.isEmpty() && statusE < 500) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

y que pasa con los status 504 Gateway Timeout creo que la condciion deberia ser solo si no es igual a 200 todo lo marque como mal y ya

@@ -38,7 +38,7 @@ public IResponse sendRequest(IRequest request)
int status = responseB.getStatusLine().getStatusCode();
client.close();
responseB.close();
if (!responseString.isEmpty()) {
if (!responseString.isEmpty() && status < 500) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lo mismo deberia validar solamente que este bien 200 y si no marca error

@@ -61,7 +61,7 @@ public IResponse sendRequest(IRequest request) throws GeneralException, AuthExce
int status = responseB.getStatusLine().getStatusCode();
client.close();
responseB.close();
if (!responseString.isEmpty()) {
if (!responseString.isEmpty() && status < 500) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lo mismo deberia validar solamente que este bien 200 y si no marca error

Copy link
Contributor Author

@JuanGamezSW JuanGamezSW Apr 30, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Si el status code es menor a 500 y no viene vacío el cuerpo, entonces entra a "obtener los datos del JSON". Esto ocurre cuando son 200, 400, 201 [aquí siempre se tiene un JSON ya sea con datos, o con errores]. Para el caso de 404 el cuerpo vendría vacío, y para errores 500 el texto no es un JSON por lo cual se estaría mostrando el cuerpo tal cual es y su texto acorde al código HTTP.

En la siguiente validación es donde se discrimina los status code 200 (success) de los demás que son errores.

Copy link

@hermesjimenez hermesjimenez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🙆‍♂

@JuanGamezSW JuanGamezSW merged commit 602c922 into develop Sep 6, 2019
@JuanGamezSW JuanGamezSW deleted the feature/0.0.4.3 branch July 30, 2020 16:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants