MCPcopy Create free account
hub / github.com/getsentry/sentry / raise_error

Method raise_error

src/sentry/integrations/base.py:553–568  ·  view source on GitHub ↗
(self, exc: Exception, identity: Identity | None = None)

Source from the content-addressed store, hash-verified

551 return ERR_INTERNAL
552
553 def raise_error(self, exc: Exception, identity: Identity | None = None) -> NoReturn:
554 if isinstance(exc, ApiUnauthorized):
555 raise InvalidIdentity(self.message_from_error(exc), identity=identity).with_traceback(
556 sys.exc_info()[2]
557 )
558 elif isinstance(exc, ApiInvalidRequestError):
559 if exc.json:
560 error_fields = self.error_fields_from_json(exc.json)
561 if error_fields is not None:
562 raise IntegrationFormError(error_fields).with_traceback(sys.exc_info()[2])
563
564 raise IntegrationError(self.message_from_error(exc)).with_traceback(sys.exc_info()[2])
565 elif isinstance(exc, IntegrationError):
566 raise
567 else:
568 raise IntegrationError(self.message_from_error(exc)).with_traceback(sys.exc_info()[2])
569
570 def is_rate_limited_error(self, exc: ApiError) -> bool:
571 return False

Callers

nothing calls this directly

Calls 5

message_from_errorMethod · 0.95
InvalidIdentityClass · 0.90
IntegrationErrorClass · 0.90

Tested by

no test coverage detected