Esempio n. 1
0
 def __init__(self, validation_error_exc):
     """Construct fault with code Client.<validation_error_type_name>."""
     message = str(validation_error_exc)
     # we do not want to reuse initialization of BaseValidationError
     Fault.__init__(
         self, faultcode='Client.{0}'.format(
             type(validation_error_exc).__name__), faultstring=message)
Esempio n. 2
0
 def __init__(self, does_not_exist_exc):
     """Construct fault with code Client.<object_name>NotFound."""
     message = str(does_not_exist_exc)
     object_name = message.split()[0]
     # we do not want to reuse initialization of ResourceNotFoundError
     Fault.__init__(
         self, faultcode='Client.{0}NotFound'.format(object_name),
         faultstring=message)
Esempio n. 3
0
    def __init__(self, message, code="HydraError"):

        Fault.__init__(self,
                faultcode=code,
                faultstring=message
        )
Esempio n. 4
0
    def __init__(self):

        Fault.__init__(self,
                faultcode='Client.AuthorizationError',
                faultstring='You are not authozied to access this resource.'
            )
Esempio n. 5
0
 def __init__(self, user_name):
     Fault.__init__(self,
             faultcode='Client.AuthenticationError',
             faultstring='Invalid authentication request for %r' % user_name
         )
Esempio n. 6
0
    def __init__(self, message):

        Fault.__init__(self,
                faultcode='NoObjectFoundError',
                faultstring=message
        )