Exemple #1
0
 def __init__(self):
     Fault.__init__(self,
             faultcode="Documented",
             faultstring="A documented fault",
             faultactor='http://faultactor.example.com',
             detail=etree.Element('something')
         )
    def __init__(self, username):
        # TODO: self.transport.http.resp_code = HTTP_401

        Fault.__init__(
            self,
            faultcode='Client.LoginUnsupported',
            faultstring='Login Unsupported for non free user  %r' % username)
Exemple #3
0
    def __init__(self):
        # TODO: self.transport.http.resp_code = HTTP_401

        Fault.__init__(self,
                faultcode='Client.AuthorizationError',
                faultstring='You are not authorized to access this resource.'
            )
Exemple #4
0
    def __init__(self, obj, custom_msg='The value %r could not be validated.'):
        s = repr(obj)

        if len(s) > MAX_STRING_FIELD_LENGTH:
            s = s[:MAX_STRING_FIELD_LENGTH] + "(...)"

        Fault.__init__(self, 'Client.ValidationError', custom_msg % s)
Exemple #5
0
    def __init__(self, obj, custom_msg='The value %r could not be validated.'):
        s = repr(obj)

        if len(s) > MAX_STRING_FIELD_LENGTH:
            s = s[:MAX_STRING_FIELD_LENGTH] + "(...)"

        Fault.__init__(self, 'Client.ValidationError', custom_msg % s)
Exemple #6
0
    def __init__(self, user_name):
        # TODO: self.transport.http.resp_code = HTTP_401

        Fault.__init__(self,
                faultcode='Client.AuthenticationError',
                faultstring='Invalid authentication request for %r' % user_name
            )
Exemple #7
0
    def __init__(self, user_name):
        # TODO: self.transport.http.resp_code = HTTP_401

        Fault.__init__(self,
                faultcode='Client.AuthenticationError',
                faultstring='Invalid authentication request for %r' % user_name
            )
Exemple #8
0
    def __init__(self):
        # TODO: self.transport.http.resp_code = HTTP_401

        Fault.__init__(self,
                faultcode='Client.AuthorizationError',
                faultstring='You are not authorized to access this resource.'
            )
Exemple #9
0
 def __init__(self):
     Fault.__init__(
         self,
         faultcode="Documented",
         faultstring="A documented fault",
         faultactor='http://faultactor.example.com',
     )
    def __init__(self, reason, username, device_id):
        # TODO: self.transport.http.resp_code = HTTP_401
        if reason == "badLogin":

            Fault.__init__(
                self,
                faultcode='Client.LoginInvalid',
                faultstring="Username or Password Fail for %r'" % username)
        elif reason == "freeUser":

            details = {'SonosError': "666", }
            Fault.__init__(
                self,
                faultcode='Client.LoginUnsupported',
                faultstring='%r is not a premium account.' % username,
                detail=details)
        elif reason == "unsupportedTerritory":

            Fault.__init__(
                self,
                faultcode="Client.UnsupportedTerritory",
                faultstring='%r is not in a supported territory.' % username)
Exemple #11
0
 def __init__(self, faultstring=""):
     Fault.__init__(self, 'Client.RequestTooLong', faultstring)
Exemple #12
0
 def __init__(self, err):
     Fault.__init__(
         self,
         faultcode="ElbeProjectError",
         faultstring=str(err))
Exemple #13
0
 def __init__(self):
     Fault.__init__(self,
                    faultcode="ElbeInvalidState",
                    faultstring="Project is Busy ! Operation Invalid")
Exemple #14
0
 def __init__(self):
     Fault.__init__(
         self,
         faultcode="ElbeNotAuthorized",
         faultstring="Not Authorized ! Cant let you perform this command.")
Exemple #15
0
 def __init__(self):
     Fault.__init__(
         self,
         faultcode="ElbeNotLoggedIn",
         faultstring="Not authenticated ! "
                     "Cant let you perform this command.")
Exemple #16
0
 def __init__(self, faultstring=""):
     Fault.__init__(self, 'Client.ArgumentError', faultstring)
Exemple #17
0
 def __init__(self, faultstring=""):
     Fault.__init__(self, 'Client.RequestTooLong', faultstring)
Exemple #18
0
 def __init__(self, faultstring=""):
     Fault.__init__(self, 'Client.ArgumentError', faultstring)
Exemple #19
0
 def __init__(self, value):
     Fault.__init__(self,
             faultcode='Client.KeyError',
             faultstring='Value %r not found' % value
         )
Exemple #20
0
 def __init__(self):
     Fault.__init__(self,
             faultcode="Documented",
             faultstring="A documented fault",
             faultactor='http://faultactor.example.com',
         )
Exemple #21
0
 def __init__(self, message):
     Fault.__init__(self,
                    faultcode='Client.SpiceError',
                    faultstring='SPICE Error: %r' % message)
Exemple #22
0
 def __init__(self):
     Fault.__init__(self, faultcode="ElbeInvalidState",
                    faultstring="Project is Busy ! Operation Invalid")
Exemple #23
0
 def __init__(self, exc):
     Fault.__init__(
         self,
         faultcode="ElbeValidationError",
         faultstring=exc.__repr__())
Exemple #24
0
 def __init__(self):
     Fault.__init__(
         self,
         faultcode="ElbeNotAuthorized",
         faultstring="Not Authorized ! Cant let you perform this command.")
Exemple #25
0
 def __init__(self, faultstring):
     Fault.__init__(self, 'Client.SchemaValidationError', faultstring)
Exemple #26
0
 def __init__(self):
     Fault.__init__(self,
             faultcode='Client.UnauthenticatedError',
             faultstring='This resource can only be accessed after authentication.'
         )
Exemple #27
0
 def __init__(self, faultstring="Requested resource not found"):
     Fault.__init__(self, 'Client.ResourceNotFound', faultstring)
Exemple #28
0
 def __init__(self, dberr):
     Fault.__init__(self, faultcode="ElbeDBError", faultstring=str(dberr))
Exemple #29
0
 def __init__(self, faultstring=""):
     Fault.__init__(self, 'Client.RequestNotAllowed', faultstring)
Exemple #30
0
 def __init__(self):
     Fault.__init__(self,
                    faultcode="ElbeAuthenticationFailed",
                    faultstring="Authentication Failed")
Exemple #31
0
 def __init__(self, value):
     Fault.__init__(self,
             faultcode='Client.KeyError',
             faultstring='Value %r not found' % value
         )
Exemple #32
0
 def __init__(self):
     Fault.__init__(
         self,
         faultcode="ElbeAuthenticationFailed",
         faultstring="Authentication Failed")
Exemple #33
0
 def __init__(self, err):
     Fault.__init__(self,
                    faultcode="ElbeProjectError",
                    faultstring=str(err))
Exemple #34
0
 def __init__(self, fault_object,
          fault_string="You do not have permission to access this resource"):
     Fault.__init__(self, 'Client.InvalidCredentialsError', fault_string)
Exemple #35
0
 def __init__(self):
     Fault.__init__(self,
                    faultcode="ElbeNotLoggedIn",
                    faultstring="Not authenticated ! "
                    "Cant let you perform this command.")
Exemple #36
0
 def __init__(self, error):
     Fault.__init__(self, 'Server', "InternalError: An unknown error has occured.")
Exemple #37
0
 def __init__(self, exc):
     Fault.__init__(self,
                    faultcode="ElbeValidationError",
                    faultstring=exc.__repr__())
Exemple #38
0
 def __init__(self, faultstring):
     Fault.__init__(self, 'Client.ValidationError',
                     'The value %r could not be validated.' % faultstring)
Exemple #39
0
 def __init__(self, fault_object,
                             fault_string="Requested resource %r not found"):
     Fault.__init__(self, 'Client.ResourceNotFound',
                                                 fault_string % fault_object)
Exemple #40
0
 def __init__(self, dberr):
     Fault.__init__(self, faultcode="ElbeDBError", faultstring=str(dberr))
Exemple #41
0
 def __init__(self, faultstring="", data=""):
     Fault.__init__(self, 'Client.InvalidInput', repr((faultstring, data)))
Exemple #42
0
 def __init__(self):
     Fault.__init__(self,
             faultcode='Client.UnauthenticatedError',
             faultstring='This resource can only be accessed after authentication.'
         )
Exemple #43
0
 def __init__(self, faultstring):
     Fault.__init__(self, 'Client.SchemaValidationError', faultstring)
Exemple #44
0
 def __init__(self, data=None):
     Fault.__init__(self, "Client.MessagePackDecodeError", data)
Exemple #45
0
 def __init__(self, faultstring="Requested resource not found"):
     Fault.__init__(self, 'Client.ResourceNotFound', faultstring)
Exemple #46
0
 def __init__(self,
              fault_object,
              fault_string="Requested resource %r not found"):
     Fault.__init__(self, 'Client.ResourceNotFound',
                    fault_string % fault_object)
Exemple #47
0
 def __init__(self, faultstring=""):
     Fault.__init__(self, 'Client.RequestNotAllowed', faultstring)
Exemple #48
0
 def __init__(
         self,
         fault_object,
         fault_string="You do not have permission to access this resource"):
     Fault.__init__(self, 'Client.InvalidCredentialsError', fault_string)
Exemple #49
0
 def __init__(self, faultstring="", data=""):
     Fault.__init__(self, 'Client.InvalidInput', repr((faultstring, data)))
Exemple #50
0
 def __init__(self, error):
     Fault.__init__(self, 'Server',
                    "InternalError: An unknown error has occured.")
Exemple #51
0
 def __init__(self, data=None):
     Fault.__init__(self, "Client.MessagePackDecodeError", data)
    def __init__(self, sessionId):
        # TODO: self.transport.http.resp_code = HTTP_401

        Fault.__init__(self,
                       faultcode='Client.SessionIdInvalid',
                       faultstring='No Valid Token for  %r' % sessionId)