MCPcopy Create free account
hub / github.com/chainreactors/EvilProxy / errorEventQuotaStatusFrom

Function errorEventQuotaStatusFrom

sdk/cliproxy/auth/error_events.go:121–131  ·  view source on GitHub ↗
(quota QuotaState)

Source from the content-addressed store, hash-verified

119}
120
121func errorEventQuotaStatusFrom(quota QuotaState) *errorEventQuotaStatus {
122 if !quota.Exceeded && strings.TrimSpace(quota.Reason) == "" && quota.NextRecoverAt.IsZero() && quota.BackoffLevel == 0 {
123 return nil
124 }
125 return &errorEventQuotaStatus{
126 Exceeded: quota.Exceeded,
127 Reason: strings.TrimSpace(quota.Reason),
128 NextRecoverAt: timePtrIfSet(quota.NextRecoverAt),
129 BackoffLevel: quota.BackoffLevel,
130 }
131}
132
133func errorEventStatusCode(err *Error) int {
134 if err != nil && err.HTTPStatus > 0 {

Callers 2

Calls 1

timePtrIfSetFunction · 0.85

Tested by

no test coverage detected