( msg string, buildID uuid.UUID, action buildFailureAction, quota *quotaErrorDetails, )
| 62 | } |
| 63 | |
| 64 | func 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 | |
| 94 | func workspaceQuotaDetails( |
| 95 | ctx context.Context, |
no test coverage detected