MCPcopy Index your code
hub / github.com/coder/coder / writeChatUsageLimitExceeded

Function writeChatUsageLimitExceeded

coderd/exp_chats.go:93–106  ·  view source on GitHub ↗
(
	ctx context.Context,
	rw http.ResponseWriter,
	limitErr *chatd.UsageLimitExceededError,
)

Source from the content-addressed store, hash-verified

91}
92
93func 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
108func maybeWriteLimitErr(ctx context.Context, rw http.ResponseWriter, err error) bool {
109 var limitErr *chatd.UsageLimitExceededError

Callers 1

maybeWriteLimitErrFunction · 0.85

Calls 1

WriteFunction · 0.92

Tested by

no test coverage detected