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

Function newQuotaError

coderd/x/chatd/chattool/quotaerror.go:64–92  ·  view source on GitHub ↗
(
	msg string,
	buildID uuid.UUID,
	action buildFailureAction,
	quota *quotaErrorDetails,
)

Source from the content-addressed store, hash-verified

62}
63
64func newQuotaError(
65 msg string,
66 buildID uuid.UUID,
67 action buildFailureAction,
68 quota *quotaErrorDetails,
69) quotaErrorResult {
70 verb := "create"
71 if action == buildFailureActionStart {
72 verb = "start"
73 }
74 message := fmt.Sprintf(
75 "Coder could not %s this workspace because your workspace quota is "+
76 "full. Delete a workspace you no longer need to free quota, or "+
77 "ask an administrator to raise your group quota allowance.",
78 verb,
79 )
80
81 r := quotaErrorResult{
82 ErrorCode: codersdk.InsufficientQuota,
83 Error: msg,
84 Title: workspaceQuotaErrorTitle,
85 Message: message,
86 Quota: quota,
87 }
88 if buildID != uuid.Nil {
89 r.BuildID = buildID.String()
90 }
91 return r
92}
93
94func workspaceQuotaDetails(
95 ctx context.Context,

Callers 1

quotaErrorToolResponseFunction · 0.85

Calls 1

StringMethod · 0.45

Tested by

no test coverage detected