mirror of
https://github.com/itplr-kosit/validator.git
synced 2026-05-25 16:55:39 +00:00
Resolve "Check result to stdout causes an exception"
This commit is contained in:
parent
7eaf9bcc09
commit
911b9a3291
1 changed files with 10 additions and 2 deletions
|
|
@ -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) {
|
||||||
System.out.println(new MessageFormat(message, Locale.ENGLISH).format(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.
|
* @param params the params.
|
||||||
*/
|
*/
|
||||||
public static void writeErr(final String message, final Object... params) {
|
public static void writeErr(final String message, final Object... params) {
|
||||||
System.err.println(new MessageFormat(message, Locale.ENGLISH).format(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 + ">");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue