comparison src/goodjava/io/IoUtils.java @ 1547:f24a9ba7551e

minor
author Franklin Schmidt <fschmidt@gmail.com>
date Thu, 24 Sep 2020 15:33:56 -0600
parents 0ba144491a42
children 736ec76bbf42
comparison
equal deleted inserted replaced
1546:2b4471d310b3 1547:f24a9ba7551e
111 throw new RuntimeException(e); 111 throw new RuntimeException(e);
112 } 112 }
113 int exitVal = proc.exitValue(); 113 int exitVal = proc.exitValue();
114 if( exitVal != 0 ) { 114 if( exitVal != 0 ) {
115 StringWriter sw = new StringWriter(); 115 StringWriter sw = new StringWriter();
116 copyAll( new InputStreamReader(proc.getInputStream()), sw ); 116 try {
117 copyAll( new InputStreamReader(proc.getInputStream()), sw );
118 } catch(IOException e) {}
117 copyAll( new InputStreamReader(proc.getErrorStream()), sw ); 119 copyAll( new InputStreamReader(proc.getErrorStream()), sw );
118 String error = sw.toString(); 120 String error = sw.toString();
119 throw new ProcException(error); 121 throw new ProcException(error);
120 } 122 }
121 } 123 }