##// END OF EJS Templates
exception-tracker: store event sending exception for easier event fail debugging.
marcink -
r3007:a41e7b95 default
parent child Browse files
Show More
@@ -17,11 +17,13 b''
17 # This program is dual-licensed. If you wish to learn more about the
17 # This program is dual-licensed. If you wish to learn more about the
18 # RhodeCode Enterprise Edition, including its added features, Support services,
18 # RhodeCode Enterprise Edition, including its added features, Support services,
19 # and proprietary license terms, please see https://rhodecode.com/licenses/
19 # and proprietary license terms, please see https://rhodecode.com/licenses/
20
20 import sys
21 import logging
21 import logging
22
22
23 from rhodecode.integrations.registry import IntegrationTypeRegistry
23 from rhodecode.integrations.registry import IntegrationTypeRegistry
24 from rhodecode.integrations.types import webhook, slack, hipchat, email, base
24 from rhodecode.integrations.types import webhook, slack, hipchat, email, base
25 from rhodecode.lib.exc_tracking import store_exception
26
25 log = logging.getLogger(__name__)
27 log = logging.getLogger(__name__)
26
28
27
29
@@ -61,6 +63,8 b' def integrations_event_handler(event):'
61 try:
63 try:
62 integration_model.send_event(integration, event)
64 integration_model.send_event(integration, event)
63 except Exception:
65 except Exception:
66 exc_info = sys.exc_info()
67 store_exception(id(exc_info), exc_info)
64 log.exception(
68 log.exception(
65 'failure occurred when sending event %s to integration %s' % (
69 'failure occurred when sending event %s to integration %s' % (
66 event, integration))
70 event, integration))
@@ -87,6 +87,13 b' def _store_exception(exc_id, exc_info, p'
87
87
88
88
89 def store_exception(exc_id, exc_info, prefix=global_prefix):
89 def store_exception(exc_id, exc_info, prefix=global_prefix):
90 """
91 Example usage::
92
93 exc_info = sys.exc_info()
94 store_exception(id(exc_info), exc_info)
95 """
96
90 try:
97 try:
91 _store_exception(exc_id=exc_id, exc_info=exc_info, prefix=prefix)
98 _store_exception(exc_id=exc_id, exc_info=exc_info, prefix=prefix)
92 except Exception:
99 except Exception:
General Comments 0
You need to be logged in to leave comments. Login now