Skip to content
Draft
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
12 changes: 11 additions & 1 deletion src/sentry/integrations/bitbucket_server/webhook.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,12 @@
from sentry.models.organization import Organization
from sentry.models.repository import Repository
from sentry.plugins.providers import IntegrationRepositoryProvider
from sentry.shared_integrations.exceptions import ApiHostError, ApiUnauthorized, IntegrationError
from sentry.shared_integrations.exceptions import (
ApiError,
ApiHostError,
ApiUnauthorized,
IntegrationError,
)
from sentry.web.frontend.base import cell_silo_view

logger = logging.getLogger("sentry.webhooks")
Expand Down Expand Up @@ -110,6 +115,11 @@ def __call__(self, event: Mapping[str, Any], **kwargs) -> None:
except ApiUnauthorized as e:
lifecycle.record_halt(halt_reason=e)
raise BadRequest()
except ApiError as e:
if e.code == 404:
lifecycle.record_halt(halt_reason=e)
continue
raise
except Exception as e:
sentry_sdk.capture_exception(e)
raise
Expand Down
Loading