From 0d66c2687837a0f8307414d6ad5636b8fcf6ce11 Mon Sep 17 00:00:00 2001 From: Randall Winkhart Date: Fri, 9 May 2025 14:48:37 +0000 Subject: [PATCH] Handle decryption error --- core/rcw.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/rcw.go b/core/rcw.go index 6b65ad3..72fef2b 100644 --- a/core/rcw.go +++ b/core/rcw.go @@ -24,7 +24,7 @@ func DecryptFileToSlice(targetLocation string) []string { // read encrypted file encBytes, err := os.ReadFile(targetLocation) if err != nil { - PrintError("Failed to decrypt \""+targetLocation+"\" - "+err.Error(), ErrorDecryption, true) + PrintError("Failed to open \""+targetLocation+"\" for decryption - "+err.Error(), ErrorDecryption, true) } // decrypt data using RCW daemon @@ -36,6 +36,9 @@ func DecryptFileToSlice(targetLocation string) []string { // if the daemon is not already running, use wrappers.Decrypt // directly to avoid waiting for socket file creation decBytes, err := wrappers.Decrypt(encBytes, passphrase) + if err != nil { + PrintError("Failed to decrypt \""+targetLocation+"\" - "+err.Error(), ErrorDecryption, true) + } return strings.Split(string(decBytes), "\n") }