(quota QuotaState)
| 119 | } |
| 120 | |
| 121 | func 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 | |
| 133 | func errorEventStatusCode(err *Error) int { |
| 134 | if err != nil && err.HTTPStatus > 0 { |
no test coverage detected