MCPcopy Create free account
hub / github.com/daodst/chat / failBlacklistableError

Function failBlacklistableError

federationapi/internal/api.go:128–143  ·  view source on GitHub ↗
(err error, stats *statistics.ServerStatistics)

Source from the content-addressed store, hash-verified

126}
127
128func failBlacklistableError(err error, stats *statistics.ServerStatistics) (until time.Time, blacklisted bool) {
129 if err == nil {
130 return
131 }
132 mxerr, ok := err.(gomatrix.HTTPError)
133 if !ok {
134 return stats.Failure()
135 }
136 if mxerr.Code == 401 { // invalid signature in X-Matrix header
137 return stats.Failure()
138 }
139 if mxerr.Code >= 500 && mxerr.Code < 600 { // internal server errors
140 return stats.Failure()
141 }
142 return
143}
144
145func (a *FederationInternalAPI) doRequestIfNotBackingOffOrBlacklisted(
146 s gomatrixserverlib.ServerName, request func() (interface{}, error),

Calls 1

FailureMethod · 0.45

Tested by

no test coverage detected