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

Method writeGraphError

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

Source from the content-addressed store, hash-verified

195 }
196}
197func (s *Server) writeGraphError(w http.ResponseWriter, r *http.Request, err error) bool {
198 if err == nil {
199 return false
200 }
201 if errors.Is(err, store.ErrScheduleItemGone) || errors.Is(err, store.ErrScheduleNotFound) {
202 err = store.ErrScheduleLinkNotFound
203 }
204 var field *store.ScheduleFieldError
205 if errors.As(err, &field) && field.Code == "ended" {
206 copy := *field
207 copy.Code = "combination"
208 err = &copy
209 }
210 if !s.writeCommitmentGraphError(w, r, err) {
211 writeScheduleError(w, err)
212 }
213 return true
214}
215
216// graphResourceEnds is private: it deliberately returns neither end to the
217// caller until the component builder has admitted both of them.

Calls 3

writeScheduleErrorFunction · 0.85
IsMethod · 0.45

Tested by

no test coverage detected