Skip to content

Commit 21eb200

Browse files
Merge 24.11 to 25.2
2 parents 7239f5d + 7ada43f commit 21eb200

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

panoramapublic/src/org/labkey/panoramapublic/proteomexchange/ProteomeXchangeService.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,10 @@
2424
import org.apache.hc.core5.http.HttpEntity;
2525
import org.apache.hc.core5.http.ParseException;
2626
import org.apache.hc.core5.http.io.entity.EntityUtils;
27+
import org.apache.logging.log4j.Logger;
2728
import org.jetbrains.annotations.NotNull;
2829
import org.labkey.api.util.PageFlowUtil;
30+
import org.labkey.api.util.logging.LogHelper;
2931

3032
import java.io.File;
3133
import java.io.IOException;
@@ -45,6 +47,8 @@ public class ProteomeXchangeService
4547

4648
private enum METHOD {submitDataset, validateXML, requestID}
4749

50+
private static final Logger LOG = LogHelper.getLogger(ProteomeXchangeService.class, "Handles requests to the ProteomeXchange server");
51+
4852
public static String validatePxXml(File pxxmlFile, boolean testDatabase, String user, String pass) throws ProteomeXchangeServiceException
4953
{
5054
return postPxXml(pxxmlFile, testDatabase, user, pass, METHOD.validateXML);
@@ -86,7 +90,7 @@ public static String getPxIdResponse(boolean testDatabase, String user, String p
8690
}
8791
catch (Exception e)
8892
{
89-
throw new ProteomeXchangeServiceException("Error requesting a ID from ProteomeXchange.", e);
93+
throw new ProteomeXchangeServiceException("Error requesting a ID from ProteomeXchange. " + e.getMessage(), e);
9094
}
9195

9296
return responseMessage;
@@ -160,6 +164,7 @@ private static String postRequest(MultipartEntityBuilder builder) throws IOExcep
160164
int statusCode = response.getCode();
161165
if (statusCode != 200)
162166
{
167+
LOG.error("Unsuccessful request to ProteomeXchange. Status code: " + statusCode + "; Response: " + responseMessage);
163168
throw new ProteomeXchangeServiceException("Error " + statusCode + " from ProteomeXchange server: " + responseMessage);
164169
}
165170
return responseMessage;

panoramapublic/src/org/labkey/panoramapublic/proteomexchange/ProteomeXchangeServiceException.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@
1515
*/
1616
package org.labkey.panoramapublic.proteomexchange;
1717

18-
public class ProteomeXchangeServiceException extends Exception
18+
import org.labkey.api.util.SkipMothershipLogging;
19+
20+
public class ProteomeXchangeServiceException extends Exception implements SkipMothershipLogging
1921
{
2022
public ProteomeXchangeServiceException(String message, Throwable cause)
2123
{

panoramapublic/src/org/labkey/panoramapublic/proteomexchange/PxXmlWriter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ void writeModificationList(Status validationStatus) throws PxException
391391
*/
392392
Element mod_list = new Element("ModificationList");
393393
var mods = validationStatus.getModifications();
394-
if(mods.size() == 0)
394+
if(mods.size() == 0 || mods.stream().noneMatch(Modification::isValid))
395395
{
396396
mod_list.addChild(new CvParamElement("MS", "MS:1002864", "No PTMs are included in the dataset"));
397397
}

0 commit comments

Comments
 (0)