File tree Expand file tree Collapse file tree
src/main/java/com/teragrep/pth_10/steps/teragrep Expand file tree Collapse file tree Original file line number Diff line number Diff line change 5656
5757import java .io .IOException ;
5858import java .io .InputStream ;
59+ import java .io .UncheckedIOException ;
5960import java .net .UnknownHostException ;
6061import java .util .ArrayList ;
6162import java .util .List ;
@@ -126,6 +127,9 @@ private List<String> getComponentVersions() {
126127 }
127128
128129 try (final InputStream is = TeragrepSystemStep .class .getClassLoader ().getResourceAsStream ("maven.properties" )) {
130+ if (is == null ) {
131+ throw new IllegalStateException ("InputStream was Null, Problem fetching package properties" );
132+ }
129133 final Properties p = new Properties ();
130134 p .load (is );
131135 LOGGER .debug ("package properties: <{}>" , p );
@@ -140,8 +144,9 @@ private List<String> getComponentVersions() {
140144 }
141145 });
142146 }
143- catch (IOException | NullPointerException e ) {
144- e .printStackTrace ();
147+ catch (IOException e ) {
148+ LOGGER .error ("Failed to load InputStream: " , e );
149+ throw new UncheckedIOException ("Failed to load InputStream: " , e );
145150 }
146151 return rv ;
147152 }
You can’t perform that action at this time.
0 commit comments