From c39425ed3b4ed92881e05e138efa14839388ae3a Mon Sep 17 00:00:00 2001 From: Craig Raw Date: Thu, 4 Apr 2024 10:41:32 +0200 Subject: [PATCH] improve logging on tor cookie read errors --- src/main/java/com/sparrowwallet/sparrow/net/TorUtils.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main/java/com/sparrowwallet/sparrow/net/TorUtils.java b/src/main/java/com/sparrowwallet/sparrow/net/TorUtils.java index 1f4fa27c..e012acd7 100644 --- a/src/main/java/com/sparrowwallet/sparrow/net/TorUtils.java +++ b/src/main/java/com/sparrowwallet/sparrow/net/TorUtils.java @@ -10,7 +10,10 @@ import org.slf4j.LoggerFactory; import java.io.*; import java.net.Socket; import java.net.SocketTimeoutException; +import java.nio.file.AccessDeniedException; +import java.nio.file.FileSystemException; import java.nio.file.Files; +import java.nio.file.NoSuchFileException; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -37,6 +40,10 @@ public class TorUtils { log.warn("Error authenticating to Tor at " + control + ", server returned " + e.getMessage()); } catch(SocketTimeoutException e) { log.warn("Timeout reading from " + control + ", is this a Tor ControlPort?"); + } catch(AccessDeniedException e) { + log.warn("Permission denied reading Tor cookie file at " + e.getFile()); + } catch(FileSystemException e) { + log.warn("Error reading Tor cookie file at " + e.getFile()); } catch(Exception e) { log.warn("Error connecting to " + control + ", no Tor ControlPort configured?"); }