Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,10 @@
import org.apache.hc.core5.http.HttpEntity;
import org.apache.hc.core5.http.ParseException;
import org.apache.hc.core5.http.io.entity.EntityUtils;
import org.apache.logging.log4j.Logger;
import org.jetbrains.annotations.NotNull;
import org.labkey.api.util.PageFlowUtil;
import org.labkey.api.util.logging.LogHelper;

import java.io.File;
import java.io.IOException;
Expand All @@ -45,6 +47,8 @@ public class ProteomeXchangeService

private enum METHOD {submitDataset, validateXML, requestID}

private static final Logger LOG = LogHelper.getLogger(ProteomeXchangeService.class, "Handles requests to the ProteomeXchange server");

public static String validatePxXml(File pxxmlFile, boolean testDatabase, String user, String pass) throws ProteomeXchangeServiceException
{
return postPxXml(pxxmlFile, testDatabase, user, pass, METHOD.validateXML);
Expand Down Expand Up @@ -86,7 +90,7 @@ public static String getPxIdResponse(boolean testDatabase, String user, String p
}
catch (Exception e)
{
throw new ProteomeXchangeServiceException("Error requesting a ID from ProteomeXchange.", e);
throw new ProteomeXchangeServiceException("Error requesting a ID from ProteomeXchange. " + e.getMessage(), e);
}

return responseMessage;
Expand Down Expand Up @@ -160,6 +164,7 @@ private static String postRequest(MultipartEntityBuilder builder) throws IOExcep
int statusCode = response.getCode();
if (statusCode != 200)
{
LOG.error("Unsuccessful request to ProteomeXchange. Status code: " + statusCode + "; Response: " + responseMessage);
throw new ProteomeXchangeServiceException("Error " + statusCode + " from ProteomeXchange server: " + responseMessage);
}
return responseMessage;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@
*/
package org.labkey.panoramapublic.proteomexchange;

public class ProteomeXchangeServiceException extends Exception
import org.labkey.api.util.SkipMothershipLogging;

public class ProteomeXchangeServiceException extends Exception implements SkipMothershipLogging
{
public ProteomeXchangeServiceException(String message, Throwable cause)
{
Expand Down