exceptions.py 666 B

123456789101112131415161718192021222324252627
  1. """
  2. flaskbb.exceptions
  3. ~~~~~~~~~~~~~~~~~~
  4. Exceptions implemented by FlaskBB.
  5. :copyright: (c) 2015 by the FlaskBBB Team.
  6. :license: BSD, see LICENSE for more details
  7. """
  8. from werkzeug.exceptions import HTTPException, Forbidden
  9. from .core.exceptions import BaseFlaskBBError
  10. class FlaskBBHTTPError(BaseFlaskBBError, HTTPException):
  11. description = "An internal error has occured"
  12. FlaskBBError = FlaskBBHTTPError
  13. class AuthorizationRequired(FlaskBBError, Forbidden):
  14. description = "Authorization is required to access this area."
  15. class AuthenticationError(FlaskBBError):
  16. description = "Invalid username and password combination."