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

Method AsPlanLimit

internal/cli/client.go:1235–1244  ·  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

1233// carries them, or nil otherwise. Returns nil for any error other than
1234// "plan_limit_exceeded" so callers can branch cleanly.
1235func (e *APIError) AsPlanLimit() *PlanLimitDetails {
1236 if e == nil || e.Code != "plan_limit_exceeded" || len(e.Details) == 0 {
1237 return nil
1238 }
1239 var d PlanLimitDetails
1240 if err := json.Unmarshal(e.Details, &d); err != nil {
1241 return nil
1242 }
1243 return &d
1244}
1245
1246// WritePlanLimitError formats a plan-limit rejection to w in the canonical
1247// two-track shape (TASK-788):

Callers 5

inviteCmdFunction · 0.80
workspaceCreateCmdFunction · 0.80
libraryActivateCmdFunction · 0.80
webhooksCreateCmdFunction · 0.80
createCmdFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected