Skip to content

Commit c84bce4

Browse files
committed
fix exception catching
1 parent b27f3c4 commit c84bce4

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

dotdrop/templategen.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,13 @@ def __init__(self, base='.', variables=None,
6262
try:
6363
mimes = mimes.split(',')
6464
self.mime_text = [mime.strip().lower() for mime in mimes]
65-
except Exception as e:
65+
except TypeError as e:
6666
self.log.warn(f'{ENV_DOTDROP_MIME_TEXT} parsing: {e}')
6767
self.mime_text = []
68+
except AttributeError as e:
69+
self.log.warn(f'{ENV_DOTDROP_MIME_TEXT} parsing: {e}')
70+
self.mime_text = []
71+
6872
loader1 = FileSystemLoader(self.base)
6973
loader2 = FunctionLoader(self._template_loader)
7074
loader = ChoiceLoader([loader1, loader2])

0 commit comments

Comments
 (0)