Commit e6e38488 authored by Łukasz Nowak's avatar Łukasz Nowak

Use correct exception, but hide sensitive details from client.

parent 859ad604
...@@ -96,6 +96,11 @@ def convertToREST(function): ...@@ -96,6 +96,11 @@ def convertToREST(function):
' real error:', ' real error:',
error=True) error=True)
raise ValidationFailed raise ValidationFailed
except Unauthorized:
LOG('SlapTool', INFO, 'Converting Unauthorized to Unauthorized,'\
' real error:',
error=True)
raise Unauthorized
self.REQUEST.response.setHeader('Content-Type', 'text/xml') self.REQUEST.response.setHeader('Content-Type', 'text/xml')
return '%s' % retval return '%s' % retval
...@@ -107,7 +112,7 @@ def _assertACI(document): ...@@ -107,7 +112,7 @@ def _assertACI(document):
if sm.checkPermission(access_contents_information, if sm.checkPermission(access_contents_information,
document): document):
return document return document
raise ValueError('User %r has no access to %r' % (sm.getUser(), document)) raise Unauthorized('User %r has no access to %r' % (sm.getUser(), document))
_MARKER = [] _MARKER = []
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment