Skip to content

Commit d24f32f

Browse files
committed
Avoid printing exception stack-trace.
Modified the WWXML class by removing the e.printStackTrace() calls. Instead, we should log any error messages to the logger.
1 parent f8d2af5 commit d24f32f

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/gov/nasa/worldwind/util/WWXML.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,8 @@ public static Document openDocumentFile(String filePath, Class c)
178178
}
179179
catch (IOException e)
180180
{
181-
e.printStackTrace();
181+
String message = Logging.getMessage("generic.ExceptionClosingStream", filePath);
182+
Logging.logger().severe(message);
182183
return null;
183184
}
184185
}
@@ -552,7 +553,9 @@ public static void closeEventReader(XMLEventReader eventReader, String name)
552553
}
553554
catch (IOException e)
554555
{
555-
e.printStackTrace();
556+
String message = Logging.getMessage("generic.ExceptionClosingStream",
557+
name != null ? name : "Unknown");
558+
Logging.logger().severe(message);
556559
}
557560
inputSources.remove(eventReader);
558561
}

0 commit comments

Comments
 (0)