1
0
mirror of https://github.com/mitb-archive/filebot synced 2025-03-10 06:20:27 -04:00

Use any lazy Object::toString as message

This commit is contained in:
Reinhard Pointner 2019-02-20 19:47:40 +07:00
parent 2dea2091d4
commit 5cce75c0b9

View File

@ -109,7 +109,7 @@ public final class Logging {
}; };
} }
public static Supplier<String> cause(String m, Throwable t) { public static Supplier<String> cause(Object m, Throwable t) {
return () -> getMessage(m, t); return () -> getMessage(m, t);
} }
@ -121,7 +121,7 @@ public final class Logging {
return () -> getMessage(elements); return () -> getMessage(elements);
} }
private static String getMessage(String m, Throwable t) { private static String getMessage(Object m, Throwable t) {
// try to unravel stacked exceptions // try to unravel stacked exceptions
if (t.getCause() != null && (t instanceof RuntimeException || t instanceof ExecutionException)) { if (t.getCause() != null && (t instanceof RuntimeException || t instanceof ExecutionException)) {
return getMessage(m, t.getCause()); return getMessage(m, t.getCause());