Browse files

more meaningfull exception

While I tried this module I wrote 


Which is a meaningfull yaml string while a meaningful dict is ecxpected in the form

    key: "value"

I propose to raise an exception instead of an assert
  • Loading branch information...
1 parent 8f2b857 commit 146e0f1a2f70d862c00ec6e77a4076d3953dc4a0 @jul jul committed Sep 20, 2012
Showing with 3 additions and 1 deletion.
  1. +3 −1 flask_flatpages/
4 flask_flatpages/
@@ -86,7 +86,9 @@ def meta(self):
# yaml.safe_load('- 1\n- a') -> [1, 'a']
if not meta:
return {}
- assert isinstance(meta, dict)
+ if not isinstance(meta, dict):
+ raise Exception("Excpecting a valid dict in meta <%(_meta_yaml)s> for page at <%(path)s>" %
+ self.__dict__)
return meta
def __getitem__(self, name):

0 comments on commit 146e0f1

Please sign in to comment.