diff --git a/portability-types-transfer/build.gradle b/portability-types-transfer/build.gradle index fe1988b59..ddeb7dc94 100644 --- a/portability-types-transfer/build.gradle +++ b/portability-types-transfer/build.gradle @@ -28,6 +28,8 @@ dependencies { annotationProcessor "com.google.auto.value:auto-value:${autoValueVersion}" compile("com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:${jacksonVersion}") + + compile('org.apache.commons:commons-lang3:3.11') testCompile("com.fasterxml.jackson.core:jackson-databind:${jacksonVersion}") testCompile("com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:${jacksonVersion}") diff --git a/portability-types-transfer/src/main/java/org/datatransferproject/types/transfer/retry/RetryMapping.java b/portability-types-transfer/src/main/java/org/datatransferproject/types/transfer/retry/RetryMapping.java index 29ba7ee83..d6fa92e3b 100644 --- a/portability-types-transfer/src/main/java/org/datatransferproject/types/transfer/retry/RetryMapping.java +++ b/portability-types-transfer/src/main/java/org/datatransferproject/types/transfer/retry/RetryMapping.java @@ -17,6 +17,7 @@ package org.datatransferproject.types.transfer.retry; import com.fasterxml.jackson.annotation.JsonProperty; +import org.apache.commons.lang3.exception.ExceptionUtils; import java.util.Arrays; /** @@ -48,13 +49,18 @@ public RetryStrategy getStrategy() { } public boolean matchesThrowable(Throwable throwable) { - // TODO: examine entire throwable, not just toString String input = throwable.toString(); for (String regex : regexes) { if (input.matches(regex)) { return true; } } + String stacktrace = ExceptionUtils.getStackTrace(throwable); + for (String regex : regexes) { + if (stacktrace.matches(regex)) { + return true; + } + } return false; }