(w http.ResponseWriter, err error)
| 632 | } |
| 633 | |
| 634 | func writeUserError(w http.ResponseWriter, err error) { |
| 635 | status := http.StatusInternalServerError |
| 636 | if errors.Is(err, users.ErrUserNotFound) { |
| 637 | status = http.StatusNotFound |
| 638 | } |
| 639 | writeJSON(w, status, map[string]any{"error": err.Error()}) |
| 640 | } |
| 641 | |
| 642 | func writeUserInboundError(w http.ResponseWriter, err error) { |
| 643 | status := http.StatusInternalServerError |
no test coverage detected