MCPcopy
hub / github.com/EverythingSuckz/TG-FileStreamBot / IsClientDisconnectError

Function IsClientDisconnectError

internal/utils/helpers.go:32–41  ·  view source on GitHub ↗

IsClientDisconnectError checks if the error is due to client disconnecting e.g. user seeking in video, stopping playback, or network issues on client side

(err error)

Source from the content-addressed store, hash-verified

30// IsClientDisconnectError checks if the error is due to client disconnecting
31// e.g. user seeking in video, stopping playback, or network issues on client side
32func IsClientDisconnectError(err error) bool {
33 if err == nil {
34 return false
35 }
36 errStr := err.Error()
37 return strings.Contains(errStr, "connection was aborted") ||
38 strings.Contains(errStr, "connection reset by peer") ||
39 strings.Contains(errStr, "broken pipe") ||
40 strings.Contains(errStr, "forcibly closed")
41}
42
43// telegram helper functions
44// TODO: move these to a separate package if they grow too large

Callers 1

getStreamRouteFunction · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected