Skip to content

Commit

Permalink
Merge pull request #12829 from gmarziou/issue_12827
Browse files Browse the repository at this point in the history
Exclude translation of DataAccessException when there's no database
  • Loading branch information
pascalgrimaud authored Oct 23, 2020
2 parents 5c2b27c + 7894fa5 commit d0a97e3
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Value;
<%_ if (databaseType !== 'no' && databaseType !== 'cassandra') { _%>
import org.springframework.dao.ConcurrencyFailureException;
<%_ } _%>
import org.springframework.dao.DataAccessException;
<%_ } _%>
import org.springframework.http.ResponseEntity;
import org.springframework.http.converter.HttpMessageConversionException;
<%_ if (reactive && databaseType === 'sql') { _%>
Expand Down Expand Up @@ -221,6 +221,7 @@ _%>
.map(this::toProblem)
.orElse(null));
}
<%_ if (databaseType !== 'no' && databaseType !== 'cassandra') { _%>

if (throwable instanceof DataAccessException) {
return Problem.builder()
Expand All @@ -233,7 +234,8 @@ _%>
.map(this::toProblem)
.orElse(null));
}

<%_ } _%>

if (containsPackageName(throwable.getMessage())) {
return Problem.builder()
.withType(type)
Expand Down

0 comments on commit d0a97e3

Please sign in to comment.