Skip to content

Commit 04d039b

Browse files
handle status codes other than 201 in else block
1 parent 81930f4 commit 04d039b

File tree

1 file changed

+0
-17
lines changed

1 file changed

+0
-17
lines changed

dspace_rest_client/client.py

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -895,24 +895,7 @@ def create_item_version(self, item_uuid, summary=None):
895895
new_version = parse_json(response)
896896
logging.info(f"Created new version for item {item_uuid}")
897897
return new_version
898-
elif response.status_code == 401:
899-
# 401 Unauthorized - Not authenticated
900-
logging.error("Unauthorized: You are not authenticated.")
901-
elif response.status_code == 403:
902-
# 403 Forbidden - Insufficient permissions or blocked entity
903-
logging.error(
904-
"Forbidden: You do not have sufficient permissions or versioning is blocked for this entity."
905-
)
906-
elif response.status_code == 400:
907-
# 400 Bad Request - URI doesn't resolve to an item
908-
logging.error("Bad Request: The URI does not resolve to an item.")
909-
elif response.status_code == 422:
910-
# 422 Unprocessable Entity - In-progress submission exists
911-
logging.error(
912-
"Unprocessable Entity: An in-progress submission for a new version already exists."
913-
)
914898
else:
915-
# Other errors
916899
logging.error(
917900
f"Error creating item version: {response.status_code} {response.text}"
918901
)

0 commit comments

Comments
 (0)