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

Suppress Error messages #965

Merged
merged 3 commits into from
Nov 2, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ protected void doPost(HttpServletRequest request, HttpServletResponse response)
sendErrorResponse(response, null, HttpServletResponse.SC_BAD_REQUEST, addedToDB.getMessage());
}
} else {
LOGGER.error("Failed to create experiment: {}", invalidKruizeObject.getValidation_data().getMessage());
LOGGER.debug("Failed to create experiment: {}", invalidKruizeObject.getValidation_data().getMessage());
Copy link
Contributor

Choose a reason for hiding this comment

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

this is actual error and need logging
coz we sending error response to user .. so let it be error itself

sendErrorResponse(response, null, invalidKruizeObject.getValidation_data().getErrorCode(), invalidKruizeObject.getValidation_data().getMessage());
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,21 +176,21 @@ public List<KruizeResultsEntry> addToDBAndFetchFailedResults(List<KruizeResultsE
} else {
message = e.getMessage();
}
LOGGER.error(message);
LOGGER.debug(message);
if (message.contains(DUPLICATE_KEY) || message.contains(DUPLICATE_KEY_ALT)) {
entry.setErrorReasons(List.of(AnalyzerErrorConstants.APIErrors.updateResultsAPI.RESULTS_ALREADY_EXISTS));
failedResultsEntries.add(entry);
} else if (message.contains(DBConstants.DB_MESSAGES.NO_PARTITION_RELATION)) {
try {
LOGGER.info(DBConstants.DB_MESSAGES.CREATE_PARTITION_RETRY);
LOGGER.debug(DBConstants.DB_MESSAGES.CREATE_PARTITION_RETRY);
tx.commit();
tx = session.beginTransaction();
// create partitions based on entry object
createPartitions(entry);
session.persist(entry);
session.flush();
} catch (Exception partitionException) {
LOGGER.error(partitionException.getMessage());
LOGGER.debug(partitionException.getMessage());
Copy link
Contributor

Choose a reason for hiding this comment

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

Should be error

entry.setErrorReasons(List.of(partitionException.getMessage()));
failedResultsEntries.add(entry);
}
Expand Down