Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError: 'NoneType' object has no attribute 'messages' #228

Closed
yakovbabich opened this issue Jan 11, 2024 · 1 comment
Closed

AttributeError: 'NoneType' object has no attribute 'messages' #228

yakovbabich opened this issue Jan 11, 2024 · 1 comment
Labels

Comments

@yakovbabich
Copy link

Describe the bug
AttributeError: 'NoneType' object has no attribute 'messages' error raises when HttpRequest.make() returned as None in client.py:_log method.

def _log(self, batch: Optional[List[RPRequestLog]]) -> Optional[Tuple[str, ...]]:
    if batch:
        url = uri_join(self.base_url_v2, 'log')
        response = HttpRequest(self.session.post, url, files=RPLogBatch(batch).payload,
                               verify_ssl=self.verify_ssl, http_timeout=self.http_timeout).make()
        return response.messages

def make(self) -> Optional[RPResponse]:
    """Make HTTP request to the ReportPortal API.

    The method catches any request preparation error to not fail reporting. Since we are reporting tool
    and should not fail tests.

    :return: wrapped HTTP response or **None** in case of failure
    """

Steps to Reproduce
Steps to reproduce the behavior:
Send very large file for which RPResponse will be returned with an error

Expected behavior
Flow is not raising AttributeError: 'NoneType' error

Actual behavior
AttributeError: 'NoneType' object has no attribute 'messages' raised

Package versions
reportportal-client:5.5.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants