forked from keybase/client
/
errors.go
65 lines (48 loc) · 1.76 KB
/
errors.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
// Copyright 2015 Keybase, Inc. All rights reserved. Use of
// this source code is governed by the included BSD license.
package engine
import (
"fmt"
keybase1 "github.com/keybase/client/go/protocol/keybase1"
)
// =============================================================================
type CheckError struct {
m string
}
func (e CheckError) Error() string {
return fmt.Sprintf("Check engine error: %s", e.m)
}
// =============================================================================
type GPGExportingError struct {
err error
inPGPGen bool // did this error happen during pgp generation?
}
func (e GPGExportingError) Error() string {
if e.inPGPGen {
const msg string = "A PGP key has been generated and added to your account, but exporting to the GPG keychain has failed. You can try to export again using `keybase pgp export -s`."
return fmt.Sprintf("%s Error during GPG exporting: %s", msg, e.err.Error())
}
return e.err.Error()
}
// =============================================================================
type PGPImportStubbedError struct {
KeyIDString string
}
func (e PGPImportStubbedError) Error() string {
return fmt.Sprintf("Key %s has a stubbed private key, so we can't import it to the Keybase keychain.",
e.KeyIDString)
}
// =============================================================================
type PGPNotActiveForLocalImport struct {
kid keybase1.KID
}
func (e PGPNotActiveForLocalImport) Error() string {
return fmt.Sprintf("Key %s is not active in user's sigchain. Publish key first to be able to import to local Keybase keychain.",
e.kid)
}
type SecretStoreNotFunctionalError struct {
err error
}
func (e SecretStoreNotFunctionalError) Error() string {
return fmt.Sprintf("Secret store not functional: %s", e.err)
}