You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# We recommend adjusting this value in production,
28
25
traces_sample_rate=1.0,
26
+
integrations=[
27
+
TrytondWSGIIntegration(),
28
+
],
29
29
)
30
30
31
31
from trytond.application import app as application
@@ -36,12 +36,11 @@ from trytond.application import app as application
36
36
In Tryton>=5.4 an error handler can be registered to respond the client
37
37
with a custom error message including the Sentry event id instead of a traceback.
38
38
39
-
```python
39
+
```python {filename:wsgi.py}
40
40
# wsgi.py
41
41
# ...
42
42
43
-
from trytond.exceptions import TrytonException
44
-
from trytond.exceptions import UserError
43
+
from trytond.exceptions import TrytonException, UserError
45
44
46
45
@application.error_handler
47
46
def_(app, request, e):
@@ -51,7 +50,6 @@ def _(app, request, e):
51
50
event_id = sentry_sdk.last_event_id()
52
51
data = UserError('Custom message', f'{event_id}\n{e}')
53
52
return app.make_response(request, data)
54
-
55
53
```
56
54
57
55
## Behavior
@@ -63,3 +61,8 @@ def _(app, request, e):
63
61
- Request data is attached to all events: **HTTP method, URL, headers, form data, JSON payloads**. Sentry excludes raw bodies and multipart file uploads. Sentry also excludes personally identifiable information (such as user ids, usernames, cookies, authorization headers, IP addresses) unless you set `send_default_pii` to `True`.
64
62
65
63
Each request has a separate scope. Changes to the scope within a view, for example setting a tag, will only apply to events sent as part of the request being handled.
0 commit comments