From 1cc8bc4ddf5b4bea96507104f5da80468ca059a7 Mon Sep 17 00:00:00 2001 From: chrys87 Date: Thu, 15 Sep 2016 11:32:16 +0200 Subject: [PATCH] add error handling for init --- src/fenrir-package/fenrir.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/fenrir-package/fenrir.py b/src/fenrir-package/fenrir.py index 5f0681fd..8d57bbbe 100755 --- a/src/fenrir-package/fenrir.py +++ b/src/fenrir-package/fenrir.py @@ -14,9 +14,12 @@ from utils import debug class fenrir(): def __init__(self): - self.environment = settingsManager.settingsManager().initFenrirConfig() - if not self.environment: - + try: + self.environment = settingsManager.settingsManager().initFenrirConfig() + if not self.environment: + raise RuntimeError('Cannot Initialize. Maybe the configfile is not available or not parseable') + except RuntimeError: + raise signal.signal(signal.SIGINT, self.captureSignal) def proceed(self):