Skip to content

Raise RedcapError when file import/export fails - #331

Merged
pwildenhain merged 1 commit into
redcap-tools:masterfrom
tarensanders:fix_330
Nov 6, 2026
Merged

pwildenhain merged 1 commit into
redcap-tools:masterfrom
tarensanders:fix_330

Conversation

@tarensanders

Copy link
Copy Markdown
Contributor

Fixes #330

Updates request.py so that for empty_json requests the actual response is checked and the RedcapError is raised if the HTTP status isn't OK or the body contains <error>. Doesn't change any behaviour for good requests (still just returns [{}]) so this shouldn't change existing working code.

I also added unit tests for failed import_file and delete_file.

It also fixes [import/delete]_file_into_repository functions since they also go through requests.py.

@pwildenhain
pwildenhain merged commit edbc34c into redcap-tools:master Nov 6, 2026
0 of 9 checks passed
@pwildenhain

Copy link
Copy Markdown
Collaborator

Thank you, good work

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unexpected Behavior: import_file does not actually raise errors on failed uploads

2 participants