niacdoial cdda40db36
Improve fsck handling and output (#2492)
* Fsck: Improved message handling and decreased commit spam.

* Merge upstream changes with local changes (part 2: manual fixes)

* pgp keyring: Do not import a pgp public key into the user's private keyring if the key there is identical to the one in the store's keyring

* fsck.go: made the code more go-idiomatic

* more changes to make code more go-idiomatic

* Fsck: fixed misleading messages caused by previous refactor

(also clarified the roles of the values in ErrorSeverity)

* Fsck: even smoother git use (pubkey updates now in the same git commit as the rest of fsck's changes)

Also removed dupeicate check of public keys, and added more tests around commit messages

* Ctxutil: Pruning unused functions, more go idiomaticity (and some tweaks regarding errors)

* Formatted files with gofmt

* fixed misc. error management

* More fixes and formatting

(plus one fixed text for the `link` action)

* unblock CI (attempt 1)

* fix problems discovered by CI

Signed-off-by: Dominik Schulz <dominik.schulz@gauner.org>
Co-authored-by: Dominik Schulz <dominik.schulz@gauner.org>
2023-01-01 14:52:55 +01:00

39 lines
2.1 KiB
Go

package store
import "fmt"
var (
// ErrExistsFailed is returend if we can't check for existence.
ErrExistsFailed = fmt.Errorf("failed to check for existence")
// ErrNotFound is returned if an entry was not found.
ErrNotFound = fmt.Errorf("entry is not in the password store")
// ErrEncrypt is returned if we failed to encrypt an entry.
ErrEncrypt = fmt.Errorf("failed to encrypt")
// ErrDecrypt is returned if we failed to decrypt and entry.
ErrDecrypt = fmt.Errorf("failed to decrypt")
// ErrIO is any kind of I/O error.
ErrIO = fmt.Errorf("i/o error")
// ErrGitInit is returned if git is already initialized.
ErrGitInit = fmt.Errorf("git is already initialized")
// ErrGitNotInit is returned if git is not initialized.
ErrGitNotInit = fmt.Errorf("git is not initialized")
// ErrGitNoRemote is returned if git has no origin remote.
ErrGitNoRemote = fmt.Errorf("git has no remote origin")
// ErrGitNothingToCommit is returned if there are no staged changes.
ErrGitNothingToCommit = fmt.Errorf("git has nothing to commit")
// ErrEmptySecret is returned if a secret exists but has no content.
ErrEmptySecret = fmt.Errorf("empty secret. see https://go.gopass.pw/faq#empty-secret")
// ErrMeaninglessWrite is returned if a secret is overwritten with its current (ciphertext) content.
ErrMeaninglessWrite = fmt.Errorf("meaningless write")
// ErrNoBody is returned if a secret exists but has no content beyond a password.
ErrNoBody = fmt.Errorf("no safe content to display, you can force display with -f")
// ErrNoPassword is returned is a secret exists but has no password, only a body.
ErrNoPassword = fmt.Errorf("no password to display, check the body of the entry instead")
// ErrYAMLNoMark is returned if a secret contains no valid YAML document marker.
ErrYAMLNoMark = fmt.Errorf("no YAML document marker found")
// ErrNoKey is returned if a KV or YAML entry doesn't contain a key.
ErrNoKey = fmt.Errorf("key not found in entry")
// ErrYAMLValueUnsupported is returned is the user tries to unmarshal an nested struct.
ErrYAMLValueUnsupported = fmt.Errorf("can not unmarshal nested YAML value")
)