Skip to content
Browse files

Added support for better logging if an authentication barrier is broken.

  • Loading branch information...
1 parent 54dc479 commit 0f46526ae37322f916662c8cdf6060b0a6196b6d @fatlotus committed
Showing with 4 additions and 1 deletion.
  1. +4 −1 src/dendrite/controllers/frontend.py
View
5 src/dendrite/controllers/frontend.py
@@ -13,7 +13,10 @@ def inner(self, sender, *vargs, **dargs):
if sender.session['auth'] is not None:
return func(self, sender, *vargs, **dargs)
else:
- raise Exception('Authentication is required for %s(..)' % func.name)
+ sender.failure('LoginRequired', 'That API call requires authentication.')
+ logging.error('Attempted to access %s(..) without authentication' %
+ func.__name__)
+ # sender.close()
return inner
def curry(self, sender, func):

0 comments on commit 0f46526

Please sign in to comment.
Something went wrong with that request. Please try again.