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

Task/improve some error logs #2331

Merged
merged 2 commits into from
Jan 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading