Skip to content

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

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions