(w http.ResponseWriter, err error)
| 640 | } |
| 641 | |
| 642 | func writeUserInboundError(w http.ResponseWriter, err error) { |
| 643 | status := http.StatusInternalServerError |
| 644 | if errors.Is(err, users.ErrUserInboundNotFound) { |
| 645 | status = http.StatusNotFound |
| 646 | } |
| 647 | writeJSON(w, status, map[string]any{"error": err.Error()}) |
| 648 | } |
| 649 | |
| 650 | var uuidRe = regexp.MustCompile(`^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$`) |
| 651 |
no test coverage detected