From 9d8752ef7cefc26c55b95e1f414705c6a6d53cb5 Mon Sep 17 00:00:00 2001 From: Ruben van de Ven Date: Fri, 10 May 2019 11:38:57 +0200 Subject: [PATCH] Bit more debugging on crashing story --- hugvey/story.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/hugvey/story.py b/hugvey/story.py index f16fb53..71d9a06 100644 --- a/hugvey/story.py +++ b/hugvey/story.py @@ -1022,9 +1022,14 @@ class Story(object): self.reset() for el in self.data: - className = storyClasses[el['@type']] - obj = className.initFromJson(el, self) - self.add(obj) + try: + className = storyClasses[el['@type']] + obj = className.initFromJson(el, self) + self.add(obj) + except Exception as e: + self.logger.critical(f"Error loading story element: {el}") + self.logger.exception(e) + raise e # self.logger.debug(self.elements) # self.logger.debug(self.directionsPerMsg)