##// 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 17 # This program is dual-licensed. If you wish to learn more about the
18 18 # RhodeCode Enterprise Edition, including its added features, Support services,
19 19 # and proprietary license terms, please see https://rhodecode.com/licenses/
20
20 import sys
21 21 import logging
22 22
23 23 from rhodecode.integrations.registry import IntegrationTypeRegistry
24 24 from rhodecode.integrations.types import webhook, slack, hipchat, email, base
25 from rhodecode.lib.exc_tracking import store_exception
26
25 27 log = logging.getLogger(__name__)
26 28
27 29
@@ -61,6 +63,8 b' def integrations_event_handler(event):'
61 63 try:
62 64 integration_model.send_event(integration, event)
63 65 except Exception:
66 exc_info = sys.exc_info()
67 store_exception(id(exc_info), exc_info)
64 68 log.exception(
65 69 'failure occurred when sending event %s to integration %s' % (
66 70 event, integration))
@@ -87,6 +87,13 b' def _store_exception(exc_id, exc_info, p'
87 87
88 88
89 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 97 try:
91 98 _store_exception(exc_id=exc_id, exc_info=exc_info, prefix=prefix)
92 99 except Exception:
General Comments 0
You need to be logged in to leave comments. Login now