feat: build wahrwelt A/D toolkit
This commit is contained in:
1 parent
303438d206
commit
653924d8c6
564 files changed
+36310
-49998
No files matched your search
@@ -0,0 +1,25 @@
|
||||
package client
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"io"
|
||||
|
||||
"github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
func checkStreamError(tp string, err error, streamErr error) bool {
|
||||
if errors.Is(err, io.EOF) {
|
||||
logrus.Errorf("Поток %s закрыт", tp)
|
||||
return false
|
||||
}
|
||||
if errors.Is(streamErr, context.Canceled) {
|
||||
logrus.Debugf("Контекст потока %s отменен", tp)
|
||||
return false
|
||||
}
|
||||
if err != nil {
|
||||
logrus.Errorf("Ошибка чтения из потока %s: %v", tp, err)
|
||||
return false
|
||||
}
|
||||
return true
|
||||
}
|
||||
Reference in new issue
Block a user