From ed77a39431d250256c9fb5b1dc4b892b39817ab6 Mon Sep 17 00:00:00 2001
From: Valentin Lorentz <vlorentz@softwareheritage.org>
Date: Mon, 19 Feb 2024 14:35:25 +0100
Subject: [PATCH] Do not report 'object too large for cache' to Sentry

---
 swh/web/utils/__init__.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/swh/web/utils/__init__.py b/swh/web/utils/__init__.py
index 44c153f6d..7acfffccd 100644
--- a/swh/web/utils/__init__.py
+++ b/swh/web/utils/__init__.py
@@ -450,7 +450,8 @@ def cache_set(
     try:
         cache.set(_compute_final_cache_key(cache_key), payload, timeout=timeout)
     except MemcacheServerError as mse:
-        sentry_sdk.capture_exception(mse)
+        if mse.args[0] != b"object too large for cache":
+            sentry_sdk.capture_exception(mse)
 
 
 def cache_get(
-- 
GitLab