summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/errors.go
diff options
context:
space:
mode:
authorWim <wim@42.be>2020-02-08 16:50:16 +0100
committerWim <wim@42.be>2020-02-08 18:33:05 +0100
commitff8cf067b8328f8a49f0a2dfd69a6ae5569cda15 (patch)
tree60047b220e9a75402e0ac53b61d3cafc4ee403fc /vendor/github.com/keybase/go-keybase-chat-bot/kbchat/errors.go
parent1420f6805070ed70f4bb60b8abafb96541ff6536 (diff)
downloadmatterbridge-msglm-ff8cf067b8328f8a49f0a2dfd69a6ae5569cda15.tar.gz
matterbridge-msglm-ff8cf067b8328f8a49f0a2dfd69a6ae5569cda15.tar.bz2
matterbridge-msglm-ff8cf067b8328f8a49f0a2dfd69a6ae5569cda15.zip
Update kekeybase/go-keybase-chat-bot vendor
Diffstat (limited to 'vendor/github.com/keybase/go-keybase-chat-bot/kbchat/errors.go')
-rw-r--r--vendor/github.com/keybase/go-keybase-chat-bot/kbchat/errors.go36
1 files changed, 36 insertions, 0 deletions
diff --git a/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/errors.go b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/errors.go
new file mode 100644
index 00000000..2b8e929d
--- /dev/null
+++ b/vendor/github.com/keybase/go-keybase-chat-bot/kbchat/errors.go
@@ -0,0 +1,36 @@
+package kbchat
+
+import "fmt"
+
+type ErrorCode int
+
+const (
+ RevisionErrorCode ErrorCode = 2760
+ DeleteNonExistentErrorCode ErrorCode = 2762
+)
+
+// Error is for unmarshaling CLI json responses
+type Error struct {
+ Code ErrorCode `json:"code"`
+ Message string `json:"message"`
+}
+
+func (e Error) Error() string {
+ return fmt.Sprintf("received error response from keybase api: %s", e.Message)
+}
+
+type APIError struct {
+ err error
+}
+
+func (e APIError) Error() string {
+ return fmt.Sprintf("failed to call keybase api: %v", e.err)
+}
+
+type UnmarshalError struct {
+ err error
+}
+
+func (e UnmarshalError) Error() string {
+ return fmt.Sprintf("failed to parse output from keybase api: %v", e.err)
+}