Skip to content

Commit

Permalink
Update the exception handler to look for string patterns (#21)
Browse files Browse the repository at this point in the history
  • Loading branch information
buinauskas authored Dec 20, 2023
1 parent a9836d7 commit b6ebe9c
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import ai.vespa.feed.client.DocumentId;
import ai.vespa.feed.client.OperationParseException;
import ai.vespa.feed.client.Result;
import ai.vespa.feed.client.ResultParseException;
import com.fasterxml.jackson.core.JsonParseException;
import com.vinted.kafka.connect.vespa.VespaReporter;
import com.vinted.kafka.connect.vespa.VespaSinkConfig;
Expand Down Expand Up @@ -107,11 +106,11 @@ private static boolean isMalformed(Throwable throwable) {
.findFirst()
.orElse(throwable);

String rootCauseString = rootCause.toString().toLowerCase();
String throwableString = throwable.toString().toLowerCase();

return !(rootCause instanceof ResultParseException)
&& (rootCauseString.contains("status 400")
|| rootCauseString.contains("string field value contains illegal code point")
return !(throwableString.contains("resultparseexception"))
&& (throwableString.contains("status 400")
|| throwableString.contains("string field value contains illegal code point")
|| rootCause instanceof OperationParseException
|| rootCause instanceof JsonParseException);
}
Expand Down

0 comments on commit b6ebe9c

Please sign in to comment.