From ffac8122736c1824e2f126b62bd6ff7ba43120b0 Mon Sep 17 00:00:00 2001 From: Arjun Patel Date: Thu, 11 Jun 2026 15:14:51 -0700 Subject: [PATCH] Update go/internal/handler/handler.go Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --- go/internal/handler/handler.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/go/internal/handler/handler.go b/go/internal/handler/handler.go index cdf23b9..4ba55c3 100644 --- a/go/internal/handler/handler.go +++ b/go/internal/handler/handler.go @@ -386,10 +386,16 @@ func (h *Handler) UpdateAvatar(w http.ResponseWriter, r *http.Request) { ContentType: r.Header.Get("Content-Type"), }, r.Body) if err != nil { + var maxErr *http.MaxBytesError + if errors.As(err, &maxErr) { + http.Error(w, "avatar file too large", http.StatusRequestEntityTooLarge) + return + } flog.Error("failed to upload avatar with depo", "error", err, "humanId", humanId) http.Error(w, "internal server error", http.StatusInternalServerError) return } + } err = h.humanSvc.UpdateAvatar(r.Context(), humanId, object.ID) if err != nil {