diff options
author | Wim <wim@42.be> | 2022-03-20 02:20:54 +0100 |
---|---|---|
committer | Wim <wim@42.be> | 2022-03-20 14:57:48 +0100 |
commit | 496d5b4ec7f5f4afae6199f928675d14d18de015 (patch) | |
tree | 3a649c80a76f0ffc33e6b3a63c0e65e892169cde /vendor/github.com/Rhymen/go-whatsapp/errors.go | |
parent | 2623a412c42a81104b97ae8c81a5f66760fee4b6 (diff) | |
download | matterbridge-msglm-496d5b4ec7f5f4afae6199f928675d14d18de015.tar.gz matterbridge-msglm-496d5b4ec7f5f4afae6199f928675d14d18de015.tar.bz2 matterbridge-msglm-496d5b4ec7f5f4afae6199f928675d14d18de015.zip |
Add whatsappmulti buildflag for whatsapp with multidevice support (whatsapp)
Diffstat (limited to 'vendor/github.com/Rhymen/go-whatsapp/errors.go')
-rw-r--r-- | vendor/github.com/Rhymen/go-whatsapp/errors.go | 42 |
1 files changed, 42 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..2f58a771 --- /dev/null +++ b/vendor/github.com/Rhymen/go-whatsapp/errors.go @@ -0,0 +1,42 @@ +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") + ErrInvalidWsState = errors.New("can't handle binary data when not logged in") + ErrConnectionTimeout = errors.New("connection timed out") + ErrMissingMessageTag = errors.New("no messageTag specified or to short") + ErrInvalidHmac = errors.New("invalid hmac") + ErrInvalidServerResponse = errors.New("invalid response received from server") + ErrServerRespondedWith404 = errors.New("server responded with status 404") + ErrInvalidWebsocket = errors.New("invalid websocket") + ErrMessageTypeNotImplemented = errors.New("message type not implemented") + ErrOptionsNotProvided = errors.New("new conn options not provided") +) + +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) +} |