DATAES-883 - Fix log level on resource load error.

Original PR: #493
This commit is contained in:
Peter-Josef Meisch 2020-07-10 21:19:11 +02:00 committed by GitHub
parent df4e6c449d
commit 0f940b36d7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View File

@ -65,13 +65,13 @@ public abstract class ReactiveResourceUtil {
sink.next(sb.toString());
sink.complete();
} catch (Exception e) {
LOGGER.debug(String.format("Failed to load file from url: %s: %s", url, e.getMessage()));
LOGGER.warn(String.format("Failed to load file from url: %s: %s", url, e.getMessage()));
sink.complete();
} finally {
DataBufferUtils.release(it);
}
}).onErrorResume(throwable -> {
LOGGER.debug(String.format("Failed to load file from url: %s: %s", url, throwable.getMessage()));
LOGGER.warn(String.format("Failed to load file from url: %s: %s", url, throwable.getMessage()));
return Mono.empty();
});
}

View File

@ -38,8 +38,8 @@ public abstract class ResourceUtil {
/**
* Read a {@link ClassPathResource} into a {@link String}.
*
* @param url
* @return
* @param url url the file url
* @return the contents of the file or null if it could not be read
*/
@Nullable
public static String readFileFromClasspath(String url) {
@ -48,7 +48,7 @@ public abstract class ResourceUtil {
try (InputStream is = classPathResource.getInputStream()) {
return StreamUtils.copyToString(is, Charset.defaultCharset());
} catch (Exception e) {
LOGGER.debug(String.format("Failed to load file from url: %s: %s", url, e.getMessage()));
LOGGER.warn(String.format("Failed to load file from url: %s: %s", url, e.getMessage()));
return null;
}
}