Ignore:
Timestamp:
2017-09-12T17:23:17+02:00 (7 years ago)
Author:
Don-vip
Message:

fix #15297, fix #15298 - proper detection of java packages on rpm-based Linux systems

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/tools/Utils.java

    r12798 r12830  
    4545import java.util.List;
    4646import java.util.Locale;
     47import java.util.concurrent.ExecutionException;
    4748import java.util.concurrent.Executor;
    4849import java.util.concurrent.ForkJoinPool;
     
    867868     * @return the output
    868869     * @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 {
    871874        if (Logging.isDebugEnabled()) {
    872875            Logging.debug(join(" ", command));
     
    884887                }
    885888            }
    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;
    887894        }
    888895    }
Note: See TracChangeset for help on using the changeset viewer.