Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't display a stack trace in the logs when .testcontainers.properties is not found #2293

Merged
merged 10 commits into from
Oct 3, 2020
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import com.google.common.annotations.VisibleForTesting;
import lombok.*;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.exception.ExceptionUtils;
import org.testcontainers.UnstableAPI;

import java.io.*;
Expand Down Expand Up @@ -169,9 +170,9 @@ private static Properties readProperties(URL url) {
try (InputStream inputStream = url.openStream()) {
properties.load(inputStream);
} catch (FileNotFoundException e) {
log.trace("Testcontainers config override was found on {} but the file was not found", url, e);
log.warn("Testcontainers config override was found on {} but the file was not found", ExceptionUtils.getRootCauseMessage(e));
rishumehrotra marked this conversation as resolved.
Show resolved Hide resolved
} catch (IOException e) {
log.warn("Testcontainers config override was found on {} but could not be loaded", url, e);
log.warn("Testcontainers config override was found on {} but could not be loaded", ExceptionUtils.getRootCauseMessage(e));
}
return properties;
}
Expand Down