def __check_response(self, msg):
        """ Search general errors in server response and raise exceptions when found.

        :keyword msg: Result message
        :raises NotAllowed: Exception raised when operation was called with
                            insufficient privileges
        :raises AuthorizationError: Credentials are invalid or missing
        :raises APISyntaxError: Syntax error
        """
        if not isinstance(msg, list):
            msg = msg.split("\n")
        if (len(msg) > 2) and self.RE_PATTERNS['not_allowed_pattern'].match(msg[2]):
            raise NotAllowed(msg[2][2:])
        if self.RE_PATTERNS['credentials_required_pattern'].match(msg[0]):
            raise AuthorizationError('Credentials required.')
        if self.RE_PATTERNS['syntax_error_pattern'].match(msg[0]):
            raise APISyntaxError(msg[2][2:] if len(msg) > 2 else 'Syntax error.')
        if self.RE_PATTERNS['bad_request_pattern'].match(msg[0]):
            raise BadRequest(msg[3] if len(msg) > 2 else 'Bad request.')
def __check_response ( self , msg ) : if not isinstance ( msg , list ) : msg = msg . split ( "\n" ) if ( len ( msg ) > 2 ) and self . RE_PATTERNS [ 'not_allowed_pattern' ] . match ( msg [ 2 ] ) : raise NotAllowed ( msg [ 2 ] [ 2 : ] ) if self . RE_PATTERNS [ 'credentials_required_pattern' ] . match ( msg [ 0 ] ) : raise AuthorizationError ( 'Credentials required.' ) if self . RE_PATTERNS [ 'syntax_error_pattern' ] . match ( msg [ 0 ] ) : raise APISyntaxError ( msg [ 2 ] [ 2 : ] if len ( msg ) > 2 else 'Syntax error.' ) if self . RE_PATTERNS [ 'bad_request_pattern' ] . match ( msg [ 0 ] ) : raise BadRequest ( msg [ 3 ] if len ( msg ) > 2 else 'Bad request.' )
Search general errors in server response and raise exceptions when found.

        :keyword msg: Result message
        :raises NotAllowed: Exception raised when operation was called with
                            insufficient privileges
        :raises AuthorizationError: Credentials are invalid or missing
        :raises APISyntaxError: Syntax error