Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

properly report error from editVersionMetadata #7641

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 8 additions & 3 deletions src/main/java/edu/harvard/iq/dataverse/api/Datasets.java
Expand Up @@ -805,11 +805,16 @@ private String getCompoundDisplayValue (DatasetFieldCompoundValue dscv){

@PUT
@Path("{id}/editMetadata")
public Response editVersionMetadata(String jsonBody, @PathParam("id") String id, @QueryParam("replace") Boolean replace) throws WrappedResponse{
public Response editVersionMetadata(String jsonBody, @PathParam("id") String id, @QueryParam("replace") Boolean replace) {

Boolean replaceData = replace != null;

DataverseRequest req = createDataverseRequest(findUserOrDie());
DataverseRequest req = null;
try {
req = createDataverseRequest(findUserOrDie());
} catch (WrappedResponse ex) {
logger.log(Level.SEVERE, "Edit metdata error: " + ex.getMessage(), ex);
return ex.getResponse();
}

return processDatasetUpdate(jsonBody, id, req, replaceData);
}
Expand Down