Skip to content

Unexpected Behavior: 500 Internal Server Error unhandled by PyCap #261

@angus-lherrou

Description

@angus-lherrou

Describe the behavior:

When a request is made with PyCap that results in a 500 Internal Server Error response, PyCap's _RCRequest.get_content does not handle this error; instead, with format_type="csv"|"xml", an empty string from response.text is silently returned, and with format_type="json", a requests.exceptions.JSONDecodeError('Expecting value: line 1 column 1 (char 0)') is raised due to response.text being an empty string.

Expected behavior:

The expected behavior would be to detect a 500 code in the request response and emit an informative error from get_content.

Desktop:

  • OS: Ubuntu 20.04.5 LTS x86_64
  • REDCap version 12.4.7
  • PyCap Version 2.4.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions