Prevent UnicodeDecodeErrors from being swallowed
UnicodeDecodeError is a subclass of ValueError, so these exceptions were being swallowed by the InvalidParameterError handling.
This commit is contained in:
parent
af5719b40c
commit
465315a7f6
|
@ -65,6 +65,10 @@ def create(
|
||||||
|
|
||||||
try:
|
try:
|
||||||
container.invokeFactory(type, content_id, **kwargs)
|
container.invokeFactory(type, content_id, **kwargs)
|
||||||
|
except UnicodeDecodeError:
|
||||||
|
# UnicodeDecodeError is a subclass of ValueError,
|
||||||
|
# so will be swallowed below unless we re-raise it here
|
||||||
|
raise
|
||||||
except ValueError, e:
|
except ValueError, e:
|
||||||
if ISiteRoot.providedBy(container):
|
if ISiteRoot.providedBy(container):
|
||||||
allowed_types = container.allowedContentTypes()
|
allowed_types = container.allowedContentTypes()
|
||||||
|
|
Reference in New Issue