MCPcopy Create free account
hub / github.com/PerpetualSoftware/pad / AsPlanLimit

Method AsPlanLimit

internal/cli/client.go:3206–3215  ·  view source on GitHub ↗

AsPlanLimit returns the parsed plan-limit details when this APIError carries them, or nil otherwise. Returns nil for any error other than "plan_limit_exceeded" so callers can branch cleanly.

()

Source from the content-addressed store, hash-verified

3204// carries them, or nil otherwise. Returns nil for any error other than
3205// "plan_limit_exceeded" so callers can branch cleanly.
3206func (e *APIError) AsPlanLimit() *PlanLimitDetails {
3207 if e == nil || e.Code != "plan_limit_exceeded" || len(e.Details) == 0 {
3208 return nil
3209 }
3210 var d PlanLimitDetails
3211 if err := json.Unmarshal(e.Details, &d); err != nil {
3212 return nil
3213 }
3214 return &d
3215}
3216
3217// WritePlanLimitError formats a plan-limit rejection to w in the canonical
3218// two-track shape (TASK-788):

Callers 7

attachmentRefusalFunction · 0.95
inviteCmdFunction · 0.80
workspaceCreateCmdFunction · 0.80
libraryActivateCmdFunction · 0.80
webhooksCreateCmdFunction · 0.80
tokenCreateCmdFunction · 0.80
createCmdFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected