diff options
author | Wim <wim@42.be> | 2022-05-02 00:10:54 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-02 00:10:54 +0200 |
commit | 81e6f75aa491c7bfa11780dd622587cf5fff3c8f (patch) | |
tree | 817bca1b4071842029af876ab622bfdcb0360cca /vendor/go.mau.fi/whatsmeow/store/store.go | |
parent | 888c8b9a845866730485a3a88c27027d0960d521 (diff) | |
download | matterbridge-msglm-81e6f75aa491c7bfa11780dd622587cf5fff3c8f.tar.gz matterbridge-msglm-81e6f75aa491c7bfa11780dd622587cf5fff3c8f.tar.bz2 matterbridge-msglm-81e6f75aa491c7bfa11780dd622587cf5fff3c8f.zip |
Update dependencies (#1822)
Diffstat (limited to 'vendor/go.mau.fi/whatsmeow/store/store.go')
-rw-r--r-- | vendor/go.mau.fi/whatsmeow/store/store.go | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/vendor/go.mau.fi/whatsmeow/store/store.go b/vendor/go.mau.fi/whatsmeow/store/store.go index 67fe38fa..19feeb7f 100644 --- a/vendor/go.mau.fi/whatsmeow/store/store.go +++ b/vendor/go.mau.fi/whatsmeow/store/store.go @@ -8,6 +8,7 @@ package store import ( + "fmt" "time" waProto "go.mau.fi/whatsmeow/binary/proto" @@ -123,6 +124,16 @@ type Device struct { Contacts ContactStore ChatSettings ChatSettingsStore Container DeviceContainer + + DatabaseErrorHandler func(device *Device, action string, attemptIndex int, err error) (retry bool) +} + +func (device *Device) handleDatabaseError(attemptIndex int, err error, action string, args ...interface{}) bool { + if device.DatabaseErrorHandler != nil { + return device.DatabaseErrorHandler(device, fmt.Sprintf(action, args...), attemptIndex, err) + } + device.Log.Errorf("Failed to %s: %v", fmt.Sprintf(action, args...), err) + return false } func (device *Device) Save() error { |