diff --git a/network/tor/src/main/java/bisq/tor/process/NativeTorProcess.java b/network/tor/src/main/java/bisq/tor/process/NativeTorProcess.java index 9a188a72bc..763c915d94 100644 --- a/network/tor/src/main/java/bisq/tor/process/NativeTorProcess.java +++ b/network/tor/src/main/java/bisq/tor/process/NativeTorProcess.java @@ -43,7 +43,7 @@ public NativeTorProcess(Path torrcPath) { this.torrcPath = torrcPath; } - public void start() throws IOException { + public void start() { String absoluteTorrcPathAsString = torrcPath.toAbsolutePath().toString(); String ownerPid = Pid.getMyPid(); @@ -57,8 +57,12 @@ public void start() throws IOException { logFileCreationWaiter = Optional.of(createLogFileCreationWaiter()); - Process torProcess = processBuilder.start(); - process = Optional.of(torProcess); + try { + Process torProcess = processBuilder.start(); + process = Optional.of(torProcess); + } catch (IOException e) { + throw new TorStartupFailedException(e); + } } public void waitUntilControlPortReady() { diff --git a/network/tor/src/main/java/bisq/tor/process/TorStartupFailedException.java b/network/tor/src/main/java/bisq/tor/process/TorStartupFailedException.java new file mode 100644 index 0000000000..e8e6518d3c --- /dev/null +++ b/network/tor/src/main/java/bisq/tor/process/TorStartupFailedException.java @@ -0,0 +1,24 @@ +/* + * This file is part of Bisq. + * + * Bisq is free software: you can redistribute it and/or modify it + * under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or (at + * your option) any later version. + * + * Bisq is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public + * License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with Bisq. If not, see . + */ + +package bisq.tor.process; + +public class TorStartupFailedException extends RuntimeException { + public TorStartupFailedException(Throwable cause) { + super(cause); + } +}