web/_exceptions.py
brancholdstable
changeset 5993 50e1a6ad3e98
parent 5426 0d4853a6e5ee
child 5940 0e3ae19b181a
equal deleted inserted replaced
5487:3ab2682a4b37 5993:50e1a6ad3e98
    51 class StatusResponse(Exception):
    51 class StatusResponse(Exception):
    52     def __init__(self, status, content=''):
    52     def __init__(self, status, content=''):
    53         self.status = int(status)
    53         self.status = int(status)
    54         self.content = content
    54         self.content = content
    55 
    55 
    56 class ExplicitLogin(AuthenticationError):
       
    57     """raised when a bad connection id is given or when an attempt to establish
       
    58     a connection failed"""
       
    59 
       
    60 class InvalidSession(CubicWebException):
    56 class InvalidSession(CubicWebException):
    61     """raised when a session id is found but associated session is not found or
    57     """raised when a session id is found but associated session is not found or
    62     invalid
    58     invalid
    63     """
    59     """
    64 
    60 
    70         self.reason = reason
    66         self.reason = reason
    71 
    67 
    72     def dumps(self):
    68     def dumps(self):
    73         from cubicweb.web import json
    69         from cubicweb.web import json
    74         return json.dumps({'reason': self.reason})
    70         return json.dumps({'reason': self.reason})
       
    71 
       
    72 class LogOut(PublishException):
       
    73     """raised to ask for deauthentication of a logged in user"""
       
    74     def __init__(self, url):
       
    75         super(LogOut, self).__init__()
       
    76         self.url = url