mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-07 01:54:22 +00:00
Added support for the CRUD operations on the MetadataField and MetadataSchema REST endpoints - feedback
This commit is contained in:
@@ -22,7 +22,10 @@ import org.springframework.web.bind.annotation.ResponseStatus;
|
||||
public class PatchBadRequestException extends RuntimeException {
|
||||
|
||||
public PatchBadRequestException(String message) {
|
||||
super(message);
|
||||
this(message, null);
|
||||
}
|
||||
|
||||
public PatchBadRequestException(String message, Exception e) {
|
||||
super(message, e);
|
||||
}
|
||||
}
|
||||
|
@@ -127,7 +127,7 @@ public class MetadataFieldRestRepository extends DSpaceRestRepository<MetadataFi
|
||||
MetadataFieldRest.class
|
||||
);
|
||||
} catch (IOException excIO) {
|
||||
throw new PatchBadRequestException("error parsing the body ..." + excIO.getMessage());
|
||||
throw new PatchBadRequestException("error parsing request body", excIO);
|
||||
}
|
||||
|
||||
// validate fields
|
||||
@@ -179,7 +179,7 @@ public class MetadataFieldRestRepository extends DSpaceRestRepository<MetadataFi
|
||||
|
||||
metadataFieldService.delete(context, metadataField);
|
||||
} catch (SQLException e) {
|
||||
throw new RuntimeException(e.getMessage(), e);
|
||||
throw new RuntimeException("error while trying to delete " + MetadataFieldRest.NAME + " with id: " + id, e);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -101,7 +101,7 @@ public class MetadataSchemaRestRepository extends DSpaceRestRepository<MetadataS
|
||||
MetadataSchemaRest.class
|
||||
);
|
||||
} catch (IOException excIO) {
|
||||
throw new PatchBadRequestException("error parsing the body ..." + excIO.getMessage());
|
||||
throw new PatchBadRequestException("error parsing request body", excIO);
|
||||
}
|
||||
|
||||
// validate fields
|
||||
@@ -141,7 +141,9 @@ public class MetadataSchemaRestRepository extends DSpaceRestRepository<MetadataS
|
||||
|
||||
metadataSchemaService.delete(context, metadataSchema);
|
||||
} catch (SQLException e) {
|
||||
throw new RuntimeException(e.getMessage(), e);
|
||||
throw new RuntimeException(
|
||||
"error while trying to delete " + MetadataSchemaRest.NAME + " with id: " + id, e
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user