Skip to content

Commit

Permalink
raise RedcapError if status code is 500
Browse files Browse the repository at this point in the history
  • Loading branch information
angus-lherrou committed Apr 18, 2023
1 parent a507d1a commit c4a6944
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions redcap/request.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,9 @@ def execute(
self.url, data=self.payload, verify=verify_ssl, files=file, **kwargs
)

if response.status_code == 500:
raise RedcapError(f"HTTP error 500 {response.reason}")

content = self.get_content(
response,
format_type=self.fmt,
Expand Down

0 comments on commit c4a6944

Please sign in to comment.