Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(derived_code_mappings): Report errors with warning level #76212

Merged
merged 4 commits into from
Aug 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/sentry/integrations/github/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import orjson
import sentry_sdk
from requests import PreparedRequest
from sentry_sdk import capture_exception, capture_message

from sentry.constants import ObjectStatus
from sentry.integrations.github.blame import (
Expand Down Expand Up @@ -427,7 +428,9 @@ def _populate_trees_process_error(self, error: ApiError, extra: dict[str, str])
else:
# We do not raise the exception so we can keep iterating through the repos.
# Nevertheless, investigate the error to determine if we should abort the processing
logger.error("Continuing execution. Investigate: %s", error_message, extra=extra)
capture_message(
"Continuing execution. Investigate: %s", error_message, extra=extra, level="warning"
)

return should_count_error

Expand All @@ -448,7 +451,8 @@ def _populate_trees(self, repositories: list[dict[str, str]]) -> dict[str, RepoT
except ApiError:
only_use_cache = True
# Report so we can investigate
logger.exception("Loading trees from cache. Execution will continue. Check logs.")
logger.warning("Loading trees from cache. Execution will continue. Check logs.")
capture_exception(level="warning")

for index, repo_info in enumerate(repositories):
repo_full_name = repo_info["full_name"]
Expand Down
Loading