forked from keybase/client
/
errors.go
33 lines (25 loc) · 912 Bytes
/
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
// Copyright 2015 Keybase, Inc. All rights reserved. Use of
// this source code is governed by the included BSD license.
package engine
import (
"fmt"
)
//=============================================================================
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()
}