-
Notifications
You must be signed in to change notification settings - Fork 531
Open
Labels
Project: Trusted DataSize: 3A percentage of a sprint. 2.1 hours.A percentage of a sprint. 2.1 hours.Type: Buga defecta defect
Milestone
Description
At https://guides.dataverse.org/en/6.7.1/api/native-api.html#delete-dataset-type we don't say you can delete a dataset type by name but if you try you'll get {} as a response and a 500 error.
Here's the stacktrace (from an unmerged, rebased branch so don't expect line numbers to make sense):
[#|2025-09-19T19:24:06.649+0000|SEVERE|Payara 6.2025.3|edu.harvard.iq.dataverse.api.errorhandlers.ThrowableHandler|_
ThreadID=86;_ThreadName=http-thread-pool::jk-connector(1);_TimeMillis=1758309846649;_LevelValue=1000;|
_status="ERROR";_code=500;_message="Internal server error. More details available at the server logs.";_incidentId
="b12bec1f-10eb-42ab-be9e-33852a2cc7ae";_interalError="IllegalArgumentException";_requestUrl="https://dev1.dataverse
.org/api/v1/datasets/datasetTypes/tmp";_requestMethod="DELETE"||#]
[#|2025-09-19T19:24:06.652+0000|SEVERE|Payara 6.2025.3|edu.harvard.iq.dataverse.api.errorhandlers.ThrowableHandler|_
ThreadID=86;_ThreadName=http-thread-pool::jk-connector(1);_TimeMillis=1758309846652;_LevelValue=1000;|
java.lang.IllegalArgumentException: ID must be a number
at edu.harvard.iq.dataverse.api.Datasets.deleteDatasetType(Datasets.java:5753)
Instead of throwing an IllegalArgumentException at https://github.com/IQSS/dataverse/blob/v6.7.1/src/main/java/edu/harvard/iq/dataverse/api/Datasets.java#L5730 I suppose we should return something like this:
return error(BAD_REQUEST, "ID must be a number.");
Or we could support deleting by name. Either way, I'll give this a 3 (a couple hours).
Metadata
Metadata
Assignees
Labels
Project: Trusted DataSize: 3A percentage of a sprint. 2.1 hours.A percentage of a sprint. 2.1 hours.Type: Buga defecta defect
Type
Projects
Status
SPRINT READY