osf.io icon indicating copy to clipboard operation
osf.io copied to clipboard

[ENG-8193] Fix issues with Preprint submission via API

Open antkryt opened this issue 7 months ago • 1 comments

Purpose

handle django core ValidationError in drf view

Changes

QA Notes

Documentation

Side Effects

Ticket

https://openscience.atlassian.net/browse/ENG-8193

antkryt avatar Jun 16 '25 13:06 antkryt

Any raised exceptions from rest_framework.exceptions (like Conflict, NotFound, ValidationError, etc.) are going to be handled by DRF and return appropriate status code. I've added unit tests to test 400 and 409, also added handling for ValueError. All other exceptions are not expected here I think, so they should return 500

JSONAPIAttributeExceptions and similar are going to be handled by our custom exception handler

antkryt avatar Jun 18 '25 15:06 antkryt