Fixed connection error handling by removing duplicated errors, standardizing on non-pointer error types

This commit is contained in:
Igor Postelnik
2021-01-20 11:52:35 -06:00
parent ce22dd681a
commit db0562c7b8
6 changed files with 34 additions and 72 deletions

View File

@@ -10,11 +10,11 @@ type ReconnectSignal struct {
}
// Error allows us to use ReconnectSignal as a special error to force connection abort
func (r *ReconnectSignal) Error() string {
func (r ReconnectSignal) Error() string {
return "reconnect signal"
}
func (r *ReconnectSignal) DelayBeforeReconnect() {
func (r ReconnectSignal) DelayBeforeReconnect() {
if r.Delay > 0 {
time.Sleep(r.Delay)
}