forked from keybase/client
-
Notifications
You must be signed in to change notification settings - Fork 0
/
errors.go
90 lines (66 loc) · 1.64 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
// Copyright 2015 Keybase, Inc. All rights reserved. Use of
// this source code is governed by the included BSD license.
package client
import (
"fmt"
"github.com/keybase/client/go/libkb"
keybase1 "github.com/keybase/client/go/protocol"
)
type NoTerminalError struct{}
func (e NoTerminalError) Error() string {
return "No Terminal available"
}
type InputCanceledError struct{}
func (e InputCanceledError) Error() string {
return "Input canceled"
}
func (e InputCanceledError) ToStatus() keybase1.Status {
return keybase1.Status{
Code: libkb.SCCanceled,
Name: "CANCELED",
Desc: "Input canceled",
}
}
type NotConfirmedError struct{}
func (e NotConfirmedError) Error() string {
return "Not confirmed"
}
type BadArgsError struct {
msg string
}
func (e BadArgsError) Error() string {
return "bad command-line arguments: " + e.msg
}
type CleanCancelError struct{}
func (e CleanCancelError) Error() string {
return "clean cancel"
}
type CanceledError struct {
msg string
}
type BadServiceError struct {
n string
}
func (e BadServiceError) Error() string {
return e.n + ": unsupported service"
}
type BadUsernameError struct {
n string
}
func (e BadUsernameError) Error() string {
return "Bad username: '" + e.n + "'"
}
type InternalError struct {
m string
}
func (e InternalError) Error() string {
return "Internal error: " + e.m
}
type ProofNotYetAvailableError struct{}
func (e ProofNotYetAvailableError) Error() string {
return "Proof wasn't available; we'll keep trying"
}
type UnexpectedArgsError string
func (e UnexpectedArgsError) Error() string {
return fmt.Sprintf("Command `%s` doesn't talk any non-flag arugments", string(e))
}