(w http.ResponseWriter, r *http.Request, err error)
| 195 | } |
| 196 | } |
| 197 | func (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 = © |
| 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. |
no test coverage detected