From 4ecf6cdad29dc250cd1372f56456913e40a1d873 Mon Sep 17 00:00:00 2001 From: whysage Date: Mon, 1 Nov 2021 23:35:50 +0200 Subject: [PATCH] #509 Add providers log on error. --- src/dependency_injector/providers.pyx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/dependency_injector/providers.pyx b/src/dependency_injector/providers.pyx index 66812223..e2da213b 100644 --- a/src/dependency_injector/providers.pyx +++ b/src/dependency_injector/providers.pyx @@ -204,7 +204,11 @@ cdef class Provider(object): if self.__last_overriding is not None: result = self.__last_overriding(*args, **kwargs) else: - result = self._provide(args, kwargs) + try: + result = self._provide(args, kwargs) + except Exception as exc: + print(self) + raise exc if self.is_async_mode_disabled(): return result