Resolve "Check result to stdout causes an exception"

This commit is contained in:
Philip Helger 2025-08-27 17:40:46 +02:00 committed by Renzo Kottmann
parent 7eaf9bcc09
commit 911b9a3291

View file

@ -38,7 +38,11 @@ public class Printer {
* @param params the params.
*/
public static void writeOut(final String message, final Object... params) {
try {
System.out.println(new MessageFormat(message, Locale.ENGLISH).format(params));
} catch (final RuntimeException ex) {
System.err.println("[Format error!] <" + message + "> with params <" + params + ">");
}
}
/**
@ -48,7 +52,11 @@ public class Printer {
* @param params the params.
*/
public static void writeErr(final String message, final Object... params) {
try {
System.err.println(new MessageFormat(message, Locale.ENGLISH).format(params));
} catch (final RuntimeException ex) {
System.err.println("[Format error!] <" + message + "> with params <" + params + ">");
}
}
/**