mirror of
https://github.com/itplr-kosit/validator.git
synced 2026-05-25 16:55:39 +00:00
FixResourceManagementIssues#2
This commit is contained in:
parent
24509aae31
commit
b323b6cc19
1 changed files with 7 additions and 4 deletions
|
|
@ -64,10 +64,13 @@ public class Printer {
|
||||||
public static void writeErr(final Exception ex, final String message, final Object... params) {
|
public static void writeErr(final Exception ex, final String message, final Object... params) {
|
||||||
writeErr(message, params);
|
writeErr(message, params);
|
||||||
if (ex != null) {
|
if (ex != null) {
|
||||||
StringWriter sw = new StringWriter();
|
try ( StringWriter sw = new StringWriter();
|
||||||
PrintWriter pw = new PrintWriter(sw);
|
PrintWriter pw = new PrintWriter(sw) ) {
|
||||||
ex.printStackTrace(pw);
|
ex.printStackTrace(pw);
|
||||||
writeErr(sw.toString());
|
writeErr(sw.toString());
|
||||||
|
} catch (IOException e) {
|
||||||
|
writeErr("Error while printing stack trace.");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue