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

Method writeGraphError

internal/server/handlers_commitment_links.go:200–217  ·  view source on GitHub ↗
(w http.ResponseWriter, r *http.Request, err error)

Source from the content-addressed store, hash-verified

198 }
199}
200func (s *Server) writeGraphError(w http.ResponseWriter, r *http.Request, err error) bool {
201 if err == nil {
202 return false
203 }
204 if errors.Is(err, store.ErrScheduleItemGone) || errors.Is(err, store.ErrScheduleNotFound) {
205 err = store.ErrScheduleLinkNotFound
206 }
207 var field *store.ScheduleFieldError
208 if errors.As(err, &field) && field.Code == "ended" {
209 copy := *field
210 copy.Code = "combination"
211 err = &copy
212 }
213 if !s.writeCommitmentGraphError(w, r, err) {
214 writeScheduleError(w, err)
215 }
216 return true
217}
218
219// publishCommitmentGraphWrite publishes item_updated, as every schedule write
220// does, for each item an applied graph write touched: its ends and every item

Calls 3

writeScheduleErrorFunction · 0.85
IsMethod · 0.45

Tested by

no test coverage detected