From 1debe6c1ed9a148646a19ca940056f78f8926e7b Mon Sep 17 00:00:00 2001 From: Harikrishnan Shaji Date: Mon, 18 Jul 2022 14:09:25 +0530 Subject: [PATCH] Gracefully fail callback function if module not found --- pellet/middleware.py | 2 +- pyproject.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pellet/middleware.py b/pellet/middleware.py index 0ea758f..ca17e8f 100644 --- a/pellet/middleware.py +++ b/pellet/middleware.py @@ -94,7 +94,7 @@ def __call__(self, request): response=response, pellet_metrics=pellet_metrics.__dict__, ) - except (AttributeError, IndexError): + except (AttributeError, IndexError, ModuleNotFoundError): logger.exception( "Pellet callback: {callback_name} failed".format( callback_name=callback_path diff --git a/pyproject.toml b/pyproject.toml index 3e2fad4..89c6453 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "pellet" -version = "0.1.2" +version = "0.1.3" description = "Pellet helps improve your Django app performance by discovering N+1 queries" authors = ["Harikrishnan Shaji "] readme = "README.md"