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

7684 - fix class import for HTTPException in DeletePidCommand #7686

Merged
merged 1 commit into from Mar 18, 2021
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
Expand Up @@ -13,12 +13,12 @@
import edu.harvard.iq.dataverse.engine.command.exception.PermissionException;
import edu.harvard.iq.dataverse.settings.SettingsServiceBean;
import edu.harvard.iq.dataverse.util.BundleUtil;
import org.apache.commons.httpclient.HttpException;

import java.util.Arrays;
import java.util.Collections;
import java.util.logging.Logger;

import javax.xml.ws.http.HTTPException;

/**
* No required permissions because we check for superuser status.
*/
Expand Down Expand Up @@ -51,8 +51,8 @@ protected void executeImpl(CommandContext ctxt) throws CommandException {
dataset.setGlobalIdCreateTime(null);
dataset.setIdentifierRegistered(false);
ctxt.datasets().merge(dataset);
} catch (HTTPException hex) {
String message = BundleUtil.getStringFromBundle("pids.deletePid.failureExpected", Arrays.asList(dataset.getGlobalId().asString(), Integer.toString(hex.getStatusCode())));
} catch (HttpException hex) {
String message = BundleUtil.getStringFromBundle("pids.deletePid.failureExpected", Arrays.asList(dataset.getGlobalId().asString(), Integer.toString(hex.getReasonCode())));
logger.info(message);
throw new IllegalCommandException(message, this);
} catch (Exception ex) {
Expand Down