From a0bfe0f65d572af797765e1331c3b1bb1f5dcd8e Mon Sep 17 00:00:00 2001 From: Michael Buesch Date: Wed, 20 Jul 2016 18:46:56 +0200 Subject: Add exception description Signed-off-by: Michael Buesch --- cms.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cms.py b/cms.py index 537d8ff..c888031 100644 --- a/cms.py +++ b/cms.py @@ -178,9 +178,9 @@ class CMSPageIdent(list): def validateSafePathComponent(cls, pcomp): if pcomp.startswith('.'): # No ".", ".." and hidden files. - raise CMSException(404) + raise CMSException(404, "Invalid page path") if [ c for c in pcomp if c not in cls.__validPathChars ]: - raise CMSException(404) + raise CMSException(404, "Invalid page path") return pcomp # Validate a path. Avoid going back in the hierarchy (. and ..) @@ -198,7 +198,7 @@ class CMSPageIdent(list): def validateName(cls, name, allowSysNames = False): if name.startswith("__") and not allowSysNames: # Page names with __ are system folders. - raise CMSException(404) + raise CMSException(404, "Invalid page name") return cls.validateSafePathComponent(name) def __init__(self, *args): -- cgit v1.2.3