Simplify error codes

This commit is contained in:
2025-06-01 14:31:46 -04:00
parent 1488c7d536
commit 499c9cdd40
9 changed files with 48 additions and 43 deletions
+3 -2
View File
@@ -6,6 +6,7 @@ import (
"github.com/rwinkhart/go-boilerplate/back"
"github.com/rwinkhart/go-boilerplate/front"
"github.com/rwinkhart/go-boilerplate/other"
"github.com/rwinkhart/libmutton/core"
"github.com/rwinkhart/libmutton/synccycles"
)
@@ -33,12 +34,12 @@ func writeEntryCLI(targetLocation string, decryptedEntry []string, hideSecrets b
// write the entry to the target location
err := core.WriteEntry(targetLocation, []byte(strings.Join(decryptedEntry, "\n")))
if err != nil {
back.PrintError("Failed to write entry: "+err.Error(), back.ErrorWrite, true)
other.PrintError("Failed to write entry: "+err.Error(), back.ErrorWrite, true)
}
// preview the entry
fmt.Println(back.AnsiBold + "\nEntry Preview:" + back.AnsiReset)
EntryReader(decryptedEntry, hideSecrets, true)
} else {
back.PrintError("No data supplied for entry", back.ErrorTargetNotFound, true)
other.PrintError("No data supplied for entry", back.ErrorTargetNotFound, true)
}
}