File tree Expand file tree Collapse file tree 1 file changed +35
-0
lines changed
src/sentry/sentry_apps/utils Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Original file line number Diff line number Diff line change 1+ from enum import Enum
2+
3+
4+ class SentryAppErrorType (Enum ):
5+ CLIENT = "client"
6+ INTEGRATOR = "integrator"
7+ SENTRY = "sentry"
8+
9+
10+ # Represents a user/client error that occured during a Sentry App process
11+ class SentryAppError (Exception ):
12+ error_type = SentryAppErrorType .CLIENT
13+ status_code = 400
14+
15+ def __init__ (
16+ self ,
17+ error : Exception | None = None ,
18+ status_code : int | None = None ,
19+ ) -> None :
20+ if status_code :
21+ self .status_code = status_code
22+
23+
24+ # Represents an error caused by a 3p integrator during a Sentry App process
25+ class SentryAppIntegratorError (Exception ):
26+ error_type = SentryAppErrorType .INTEGRATOR
27+ status_code = 400
28+
29+ def __init__ (
30+ self ,
31+ error : Exception | None = None ,
32+ status_code : int | None = None ,
33+ ) -> None :
34+ if status_code :
35+ self .status_code = status_code
You can’t perform that action at this time.
0 commit comments