Assign error-specific exit codes to constants

This commit is contained in:
2024-08-13 20:48:20 -04:00
parent a1c9827c04
commit 4c54349b39
17 changed files with 90 additions and 92 deletions
+2 -2
View File
@@ -19,7 +19,7 @@ func DecryptGPG(targetLocation string) []string {
if err != nil {
fmt.Println(AnsiError + "Failed to decrypt \"" + targetLocation + "\" - Ensure it is a valid GPG-encrypted file and that you entered your passphrase correctly" + AnsiReset)
os.Exit(108)
os.Exit(ErrorDecryption)
}
outputSlice := strings.Split(string(output), "\n")
@@ -33,7 +33,7 @@ func EncryptGPG(input []string) []byte {
encryptedBytes, err := cmd.Output()
if err != nil {
fmt.Println(AnsiError + "Failed to encrypt data - Ensure that your GPG key is valid and that you have a valid GPG ID set in libmutton.ini" + AnsiReset)
os.Exit(109)
os.Exit(ErrorEncryption)
}
return encryptedBytes
}