From 064ac12b366531c1d528c16f22aa5b64977041cc Mon Sep 17 00:00:00 2001 From: crschnick Date: Mon, 21 Aug 2023 20:33:21 +0000 Subject: [PATCH] Improve error message --- .../main/java/io/xpipe/app/util/SecretRetrievalStrategy.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/src/main/java/io/xpipe/app/util/SecretRetrievalStrategy.java b/app/src/main/java/io/xpipe/app/util/SecretRetrievalStrategy.java index 6adacc22d..09fb6ab44 100644 --- a/app/src/main/java/io/xpipe/app/util/SecretRetrievalStrategy.java +++ b/app/src/main/java/io/xpipe/app/util/SecretRetrievalStrategy.java @@ -4,8 +4,10 @@ import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeName; +import io.xpipe.app.issue.ErrorEvent; import io.xpipe.app.prefs.AppPrefs; import io.xpipe.core.impl.LocalStore; +import io.xpipe.core.process.ProcessOutputException; import io.xpipe.core.util.SecretValue; import lombok.Builder; import lombok.Getter; @@ -140,6 +142,8 @@ public interface SecretRetrievalStrategy { try (var cc = new LocalStore().createBasicControl().command(cmd).start()) { return SecretHelper.encrypt(cc.readStdoutOrThrow()); + } catch (ProcessOutputException ex) { + throw ErrorEvent.unreportable(ProcessOutputException.withPrefix("Unable to retrieve password with command " + cmd, ex)); } }