diff options
author | Wim <wim@42.be> | 2019-05-30 12:20:56 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-30 12:20:56 +0200 |
commit | 3418e8c9afbdf3e94ab26a20d8f12c042ae29fc4 (patch) | |
tree | c5358b971a95749bece9469e959041d4f2e54cc3 /vendor/github.com/Rhymen/go-whatsapp/errors.go | |
parent | 9619dff33417548a50e51a4f75f41b9de4a73327 (diff) | |
download | matterbridge-msglm-3418e8c9afbdf3e94ab26a20d8f12c042ae29fc4.tar.gz matterbridge-msglm-3418e8c9afbdf3e94ab26a20d8f12c042ae29fc4.tar.bz2 matterbridge-msglm-3418e8c9afbdf3e94ab26a20d8f12c042ae29fc4.zip |
Use upstream whatsapp again (#809)
Diffstat (limited to 'vendor/github.com/Rhymen/go-whatsapp/errors.go')
-rw-r--r-- | vendor/github.com/Rhymen/go-whatsapp/errors.go | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/vendor/github.com/Rhymen/go-whatsapp/errors.go b/vendor/github.com/Rhymen/go-whatsapp/errors.go new file mode 100644 index 00000000..793f8cc9 --- /dev/null +++ b/vendor/github.com/Rhymen/go-whatsapp/errors.go @@ -0,0 +1,35 @@ +package whatsapp + +import ( + "fmt" + "github.com/pkg/errors" +) + +var ( + ErrAlreadyConnected = errors.New("already connected") + ErrAlreadyLoggedIn = errors.New("already logged in") + ErrInvalidSession = errors.New("invalid session") + ErrLoginInProgress = errors.New("login or restore already running") + ErrNotConnected = errors.New("not connected") + ErrInvalidWsData = errors.New("received invalid data") + ErrConnectionTimeout = errors.New("connection timed out") + ErrMissingMessageTag = errors.New("no messageTag specified or to short") + ErrInvalidHmac = errors.New("invalid hmac") +) + +type ErrConnectionFailed struct { + Err error +} + +func (e *ErrConnectionFailed) Error() string { + return fmt.Sprintf("connection to WhatsApp servers failed: %v", e.Err) +} + +type ErrConnectionClosed struct { + Code int + Text string +} + +func (e *ErrConnectionClosed) Error() string { + return fmt.Sprintf("server closed connection,code: %d,text: %s", e.Code, e.Text) +} |