Skip to content

Commit

Permalink
Merge pull request #2331 from telefonicaid/task/improve_some_error_logs
Browse files Browse the repository at this point in the history
Task/improve some error logs
  • Loading branch information
fgalan authored Jan 24, 2024
2 parents 124d62f + 639f9f1 commit cee12bc
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGES_NEXT_RELEASE
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
- [cygnus-common] [Arcgis] include error in log about cast attributes json
- [cygnus-common] Upgrade Debian version from 12.1 to 12.4 in Dockerfile
- [cygnus-common][NGSIGenericColumnAggregator] Fix getValue when gson object is null

Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ public static boolean checkHttpResponse(HttpResponse response) {
checkHttpResponse(response.getBody());
isSuccessful = true;
} catch (ArcgisException e) {
LOGGER.debug("Response has erros, " + e);
LOGGER.debug("Response has erros, " + e.toString());
response.setError(e);
}
} else {
Expand Down Expand Up @@ -401,7 +401,7 @@ protected static JsonElement getErrorJsonobject(JsonObject httpResponse)
result = httpResponse.get(DELETE_RESULTS_RESPONSE_TAG);
}
} catch (Exception e) {
LOGGER.error(e);
LOGGER.error(e.getMessage());
throw new ArcgisException(e);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -420,8 +420,10 @@ public void getTableAttributesInfo() throws ArcgisException {
}

} catch (ArcgisException e) {
LOGGER.error(e.toString());
throw e;
} catch (Exception e) {
LOGGER.error("getTableAttributesInfo, Unexpected Exception " + e.toString());
throw new ArcgisException(
"getTableAttributesInfo, Unexpected Exception " + e.toString());
}
Expand Down Expand Up @@ -450,6 +452,7 @@ protected void getUniqueIdFieldFromJson(String jsonStr) throws ArcgisException {
LOGGER.info("WARN: Feature table has not uniqueIdField");
}
} catch (Exception e) {
LOGGER.error("Error getting uniqueIdField, " + e.getLocalizedMessage());
throw new ArcgisException("Error getting uniqueIdField, " + e.getLocalizedMessage());
}
}
Expand All @@ -473,8 +476,8 @@ protected void getAttributeInfoFromJson(String jsonStr) throws ArcgisException {
this.tableAttributes.put(field.getName(), field);
}
} catch (Exception e) {
LOGGER.error("Can't cast Attributes from Json " + jsonStr);
throw new ArcgisException("Can't cast attributes from Json, " + jsonStr);
LOGGER.error("Can't cast Attributes from Json " + jsonStr + " due to " + e.getMessage());
throw new ArcgisException("Can't cast attributes from Json, " + jsonStr + "due to " + e.getMessage());
}
}

Expand Down Expand Up @@ -504,7 +507,8 @@ protected void getAttributeIndexFromJson(String jsonStr) throws ArcgisException
}
}
} catch (Exception e) {
LOGGER.error("Error setting unique attributes");
LOGGER.error("Error setting unique attributes: "
+ e.getClass().getSimpleName() + " " + e.getMessage());
throw new ArcgisException("Error setting unique attributes, "
+ e.getClass().getSimpleName() + " " + e.getMessage());
}
Expand Down Expand Up @@ -591,6 +595,7 @@ protected ResultPage<Feature> resultPageFromJson(String responseJson, String lis
if (json.get(ERROR_TAG) != null) {
errorDesc = json.get(ERROR_TAG).toString();
}
LOGGER.error(errorDesc);
throw new ArcgisException(errorDesc);
}

Expand Down

0 comments on commit cee12bc

Please sign in to comment.