We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2680740 commit 0fb00c4Copy full SHA for 0fb00c4
telegram/utils/promise.py
@@ -18,9 +18,14 @@
18
# along with this program. If not, see [http://www.gnu.org/licenses/].
19
""" This module contains the Promise class """
20
21
+import logging
22
from threading import Event
23
24
25
+logger = logging.getLogger(__name__)
26
+logger.addHandler(logging.NullHandler())
27
+
28
29
class Promise(object):
30
"""A simple Promise implementation for the run_async decorator"""
31
@@ -37,6 +42,7 @@ def run(self):
37
42
self._result = self.pooled_function(*self.args, **self.kwargs)
38
43
39
44
except Exception as exc:
45
+ logger.exception('An uncaught error was raised while running the promise')
40
46
self._exception = exc
41
47
48
finally:
0 commit comments