Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F7085379
D7576.id27931.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
3 KB
Subscribers
None
D7576.id27931.diff
View Options
diff --git a/swh/loader/core/loader.py b/swh/loader/core/loader.py
--- a/swh/loader/core/loader.py
+++ b/swh/loader/core/loader.py
@@ -11,6 +11,8 @@
import sentry_sdk
+import sentry_sdk
+
from swh.core.config import load_from_envvar
from swh.loader.core.metadata_fetchers import CredentialsType, get_fetchers_for_lister
from swh.loader.exception import NotFound
@@ -321,6 +323,7 @@
except Exception:
msg = "Cleaning up dangling data failed! Continue loading."
self.log.warning(msg)
+ sentry_sdk.capture_exception()
self._store_origin_visit()
@@ -388,6 +391,7 @@
},
},
)
+ sentry_sdk.capture_exception()
visit_status = OriginVisitStatus(
origin=self.origin.url,
visit=self.visit.visit,
diff --git a/swh/loader/package/deposit/loader.py b/swh/loader/package/deposit/loader.py
--- a/swh/loader/package/deposit/loader.py
+++ b/swh/loader/package/deposit/loader.py
@@ -11,6 +11,7 @@
import attr
import requests
+import sentry_sdk
from swh.core.config import load_from_envvar
from swh.loader.core.loader import DEFAULT_CONFIG
@@ -241,7 +242,8 @@
try:
self.metadata()
except ValueError:
- logger.error(f"Unknown deposit {self.deposit_id}, ignoring")
+ logger.exception(f"Unknown deposit {self.deposit_id}")
+ sentry_sdk.capture_exception()
return {"status": "failed"}
# Then usual loading
@@ -289,6 +291,7 @@
)
except Exception:
logger.exception("Problem when trying to update the deposit's status")
+ sentry_sdk.capture_exception()
return {"status": "failed"}
return r
@@ -343,7 +346,6 @@
return r.json()
msg = f"Problem when retrieving deposit metadata at {url}"
- logger.error(msg)
raise ValueError(msg)
def status_update(
diff --git a/swh/loader/package/loader.py b/swh/loader/package/loader.py
--- a/swh/loader/package/loader.py
+++ b/swh/loader/package/loader.py
@@ -323,9 +323,17 @@
)
}
if missing_releases:
- logger.error(
- "Found ExtIDs pointing to missing releases: %s", missing_releases
- )
+
+ err_message = "Found ExtIDs pointing to missing releases"
+
+ logger.error(err_message + ": %s", missing_releases)
+
+ with sentry_sdk.push_scope() as scope:
+ scope.set_extra(
+ "missing_releases", [str(x) for x in missing_releases]
+ )
+ sentry_sdk.capture_message(err_message, "error")
+
release_extid_targets -= missing_releases
extid_target2 = self.select_extid_target(p_info, release_extid_targets)
@@ -575,6 +583,7 @@
errors=[str(e)],
)
except Exception as e:
+ sentry_sdk.capture_exception(e)
return self.finalize_visit(
snapshot=snapshot,
visit=visit,
@@ -880,7 +889,9 @@
# Deal with extra-branches
for name, branch_target in extra_branches.items():
if name in branches:
- logger.error("Extra branch '%s' has been ignored", name)
+ error_message = f"Extra branch '{name!r}' has been ignored"
+ logger.error(error_message)
+ sentry_sdk.capture_message(error_message, "error")
else:
branches[name] = branch_target
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Nov 18, 9:44 PM (17 h, 53 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3215754
Attached To
D7576: Add missing Sentry Captures
Event Timeline
Log In to Comment