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

Method ContentSetAsideRows

internal/cli/client.go:2734–2745  ·  view source on GitHub ↗

ContentSetAsideRows reads details.set_aside_rows from a content_pending_flush refusal: how many set-aside edit rows caused it. Zero when the refusal was about unflushed edits only, or came from a server that predates BUG-3244.

()

Source from the content-addressed store, hash-verified

2732// refusal: how many set-aside edit rows caused it. Zero when the refusal was
2733// about unflushed edits only, or came from a server that predates BUG-3244.
2734func (e *APIError) ContentSetAsideRows() int {
2735 if e == nil || len(e.Details) == 0 {
2736 return 0
2737 }
2738 var d struct {
2739 SetAsideRows int `json:"set_aside_rows"`
2740 }
2741 if json.Unmarshal(e.Details, &d) != nil {
2742 return 0
2743 }
2744 return d.SetAsideRows
2745}
2746
2747// AsContentPendingFlush reports whether the server refused the write with
2748// content_pending_flush.

Callers 2

updateCmdFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected