This is the codeAbility Sharing Platform! Learn more about the codeAbility Sharing Platform.

Skip to content
Snippets Groups Projects

Resolve "Sharing Plattform: Prüfung: Gitlab Login für Simon in Produktion funktioniert nicht zuverlässig."

Files
4
@@ -78,10 +78,14 @@ public class ElasticSearchRepository {
return i.index(index).id(exerciseId).document(document);
});
final String exerciseId2 = document.getExerciseId();
try {
ExerciseId parsedId = ExerciseId.fromString(exerciseId2);
} catch (ParseException e) {
LOGGER.error("Somehow we got an corrupt exerciseId {}", exerciseId2, e);
if (exerciseId2 == null) {
LOGGER.error("Somehow we got an empty exerciseId in {}", document);
} else {
try {
ExerciseId.fromString(exerciseId2);
} catch (ParseException e) {
LOGGER.error("Somehow we got an corrupt exerciseId {}", exerciseId2, e);
}
}
return exerciseId2;
}
@@ -158,9 +162,13 @@ public class ElasticSearchRepository {
* @throws ElasticsearchException
* @throws IOException
*/
@SuppressWarnings("null")
public SearchResultDTO get(final String docId) throws IOException {
final GetResponse<SearchResultDTO> searchResultDTOResponse =
this.elasticsearchAPIClient.get(r -> r.index(SearchRepositoryConstants.INDEX_METADATA).id(docId), SearchResultDTO.class);
if (searchResultDTOResponse.source() != null) {
searchResultDTOResponse.source().setExerciseId(docId);
}
return searchResultDTOResponse.source();
}