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

Method AsPlanLimit

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

2845// carries them, or nil otherwise. Returns nil for any error other than
2846// "plan_limit_exceeded" so callers can branch cleanly.
2847func (e *APIError) AsPlanLimit() *PlanLimitDetails {
2848 if e == nil || e.Code != "plan_limit_exceeded" || len(e.Details) == 0 {
2849 return nil
2850 }
2851 var d PlanLimitDetails
2852 if err := json.Unmarshal(e.Details, &d); err != nil {
2853 return nil
2854 }
2855 return &d
2856}
2857
2858// WritePlanLimitError formats a plan-limit rejection to w in the canonical
2859// two-track shape (TASK-788):

Callers 6

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