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):
' real error:',
error=True)
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')
return '%s' % retval
......@@ -107,7 +112,7 @@ def _assertACI(document):
if sm.checkPermission(access_contents_information,
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 = []
......
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