mirror of
https://github.com/rwinkhart/MUTN.git
synced 2026-09-01 14:47:21 -04:00
Simplify error codes
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user