Changeset 12830 in josm for trunk/src/org/openstreetmap/josm/tools/Utils.java
- Timestamp:
- 2017-09-12T17:23:17+02:00 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/tools/Utils.java
r12798 r12830 45 45 import java.util.List; 46 46 import java.util.Locale; 47 import java.util.concurrent.ExecutionException; 47 48 import java.util.concurrent.Executor; 48 49 import java.util.concurrent.ForkJoinPool; … … 867 868 * @return the output 868 869 * @throws IOException when there was an error, e.g. command does not exist 869 */ 870 public static String execOutput(List<String> command) throws IOException { 870 * @throws ExecutionException when the return code is != 0. The output is can be retrieved in the exception message 871 * @throws InterruptedException if the current thread is {@linkplain Thread#interrupt() interrupted} by another thread while waiting 872 */ 873 public static String execOutput(List<String> command) throws IOException, ExecutionException, InterruptedException { 871 874 if (Logging.isDebugEnabled()) { 872 875 Logging.debug(join(" ", command)); … … 884 887 } 885 888 } 886 return all != null ? all.toString() : null; 889 String msg = all != null ? all.toString() : null; 890 if (p.waitFor() != 0) { 891 throw new ExecutionException(msg, null); 892 } 893 return msg; 887 894 } 888 895 }
Note:
See TracChangeset
for help on using the changeset viewer.