( attempt int, delay time.Duration, classified ClassifiedError, )
| 21 | } |
| 22 | |
| 23 | func StreamRetryPayload( |
| 24 | attempt int, |
| 25 | delay time.Duration, |
| 26 | classified ClassifiedError, |
| 27 | ) *codersdk.ChatStreamRetry { |
| 28 | if classified.Message == "" { |
| 29 | return nil |
| 30 | } |
| 31 | return &codersdk.ChatStreamRetry{ |
| 32 | Attempt: attempt, |
| 33 | DelayMs: delay.Milliseconds(), |
| 34 | Error: retryMessage(classified), |
| 35 | Kind: classified.Kind, |
| 36 | Provider: classified.Provider, |
| 37 | StatusCode: classified.StatusCode, |
| 38 | RetryingAt: time.Now().Add(delay), |
| 39 | } |
| 40 | } |