( ctx context.Context, rw http.ResponseWriter, limitErr *chatd.UsageLimitExceededError, )
| 91 | } |
| 92 | |
| 93 | func writeChatUsageLimitExceeded( |
| 94 | ctx context.Context, |
| 95 | rw http.ResponseWriter, |
| 96 | limitErr *chatd.UsageLimitExceededError, |
| 97 | ) { |
| 98 | httpapi.Write(ctx, rw, http.StatusConflict, codersdk.ChatUsageLimitExceededResponse{ |
| 99 | Response: codersdk.Response{ |
| 100 | Message: "Chat usage limit exceeded.", |
| 101 | }, |
| 102 | SpentMicros: limitErr.ConsumedMicros, |
| 103 | LimitMicros: limitErr.LimitMicros, |
| 104 | ResetsAt: limitErr.PeriodEnd, |
| 105 | }) |
| 106 | } |
| 107 | |
| 108 | func maybeWriteLimitErr(ctx context.Context, rw http.ResponseWriter, err error) bool { |
| 109 | var limitErr *chatd.UsageLimitExceededError |
no test coverage detected