| | |
| | | from pyramid.httpexceptions import ( |
| | | HTTPBadRequest, |
| | | HTTPNotFound, |
| | | HTTPForbidden, |
| | | ) |
| | | from pyramid.httpexceptions import HTTPBadRequest, HTTPNotFound, HTTPForbidden |
| | | |
| | | NotFound = HTTPNotFound # bw compat |
| | | Forbidden = HTTPForbidden # bw compat |
| | | NotFound = HTTPNotFound # bw compat |
| | | Forbidden = HTTPForbidden # bw compat |
| | | |
| | | CR = '\n' |
| | | |
| | |
| | | This exception indicates the request has failed cross-site request forgery |
| | | origin validation. |
| | | """ |
| | | |
| | | title = "Bad CSRF Origin" |
| | | explanation = ( |
| | | "Access is denied. This server can not verify that the origin or " |
| | |
| | | This exception indicates the request has failed cross-site request |
| | | forgery token validation. |
| | | """ |
| | | |
| | | title = 'Bad CSRF Token' |
| | | explanation = ( |
| | | 'Access is denied. This server can not verify that your cross-site ' |
| | |
| | | 'supplied the wrong cross-site request forgery token or your session ' |
| | | 'no longer exists. This may be due to session timeout or because ' |
| | | 'browser is not supplying the credentials required, as can happen ' |
| | | 'when the browser has cookies turned off.') |
| | | 'when the browser has cookies turned off.' |
| | | ) |
| | | |
| | | |
| | | class PredicateMismatch(HTTPNotFound): |
| | | """ |
| | |
| | | exception view. |
| | | """ |
| | | |
| | | |
| | | class URLDecodeError(UnicodeDecodeError): |
| | | """ |
| | | This exception is raised when :app:`Pyramid` cannot |
| | |
| | | decoded. |
| | | """ |
| | | |
| | | |
| | | class ConfigurationError(Exception): |
| | | """ Raised when inappropriate input values are supplied to an API |
| | | method of a :term:`Configurator`""" |
| | | |
| | | |
| | | class ConfigurationConflictError(ConfigurationError): |
| | | """ Raised when a configuration conflict is detected during action |
| | |
| | | r = ["Conflicting configuration actions"] |
| | | items = sorted(self._conflicts.items()) |
| | | for discriminator, infos in items: |
| | | r.append(" For: %s" % (discriminator, )) |
| | | r.append(" For: %s" % (discriminator,)) |
| | | for info in infos: |
| | | for line in str(info).rstrip().split(CR): |
| | | r.append(" " + line) |
| | |
| | | class CyclicDependencyError(Exception): |
| | | """ The exception raised when the Pyramid topological sorter detects a |
| | | cyclic dependency.""" |
| | | |
| | | def __init__(self, cycles): |
| | | self.cycles = cycles |
| | | |