Merge branch '130-check-result-to-stdout-causes-an-exception' into 'release/1.5.x'

Resolve "Check result to stdout causes an exception"

See merge request kosit/validator!70
This commit is contained in:
Renzo Kottmann 2025-08-27 17:40:46 +02:00
commit 22910c1ca0

View file

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