Skip to content

Commit

Permalink
return exception in case of the eTransl error callback
Browse files Browse the repository at this point in the history
  • Loading branch information
SrdjanStevanetic committed May 15, 2024
1 parent ca8a33b commit 8560834
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,11 @@ private void createRedisMessageListenerAndWaitForResults(List<TranslationObj> tr
if(LOGGER.isDebugEnabled()) {
LOGGER.debug("Received message from redis message listener is: {}", response);
}
if(response!=null) {
if(response.contains(ETranslationTranslationService.eTranslationErrorCallbackIndicator)) {
//eTtransl error callback received
throw new TranslationException(response);
}
else if(response!=null) {
//extractTranslationsFromETranslationHtmlResponse(translationObjs, redisMessageListenerAdapter, response);
extractTranslationsFromETranslationResponse(translationObjs, redisMessageListenerAdapter, response);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public void onMessage(Message message, byte[] pattern) {
String messageBody=new String(message.getBody(), StandardCharsets.UTF_8);
if(messageBody.contains(ETranslationTranslationService.eTranslationErrorCallbackIndicator)) {
//if we enter here, means the eTranslation error callback is called
this.message=null;
this.message=messageBody;
}
else {
/*
Expand Down

0 comments on commit 8560834

Please sign in to comment.