Skip to content
This repository was archived by the owner on Jan 23, 2025. It is now read-only.

Commit c838f1f

Browse files
committed
I-145106
1 parent d9b49cc commit c838f1f

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

src/java/main/com/topcoder/direct/services/view/action/analytics/longcontest/MarathonMatchHelper.java

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
*/
44
package com.topcoder.direct.services.view.action.analytics.longcontest;
55

6+
import com.topcoder.commons.utils.LoggingWrapperUtility;
67
import com.topcoder.direct.services.view.action.analytics.longcontest.services.MarathonMatchAnalyticsService;
78
import com.topcoder.direct.services.view.action.analytics.longcontest.services.MarathonMatchAnalyticsServiceException;
89
import com.topcoder.direct.services.view.dto.contest.BaseContestCommonDTO;
@@ -24,6 +25,8 @@
2425
import com.topcoder.web.tc.rest.longcontest.resources.MatchResultResource;
2526
import com.topcoder.web.tc.rest.longcontest.resources.ProgressResource;
2627
import com.topcoder.web.tc.rest.longcontest.resources.SearchResult;
28+
import com.topcoder.util.log.Log;
29+
import com.topcoder.util.log.LogManager;
2730
import org.codehaus.jackson.map.ObjectMapper;
2831
import org.codehaus.jackson.node.ArrayNode;
2932
import org.codehaus.jackson.node.ObjectNode;
@@ -101,6 +104,11 @@ public final class MarathonMatchHelper {
101104
*/
102105
public static final String GROUP_TYPE_DAY = "day";
103106

107+
/**
108+
* Log instance.
109+
*/
110+
private static final Log logger = LogManager.getLog(MarathonMatchHelper.class.getName());
111+
104112
/**
105113
* Get the marathon match details information of this marathon match contest.
106114
*
@@ -211,9 +219,16 @@ public int compare(CompetitorResource competitorResource, CompetitorResource com
211219
*/
212220
public static boolean isMarathonMatchActive(Long roundId,
213221
MarathonMatchAnalyticsService marathonMatchAnalyticsService) throws MarathonMatchAnalyticsServiceException {
214-
SearchResult<MarathonMatchItemResource> activeContests =
222+
SearchResult<MarathonMatchItemResource> activeContests = null;
223+
224+
try {
225+
activeContests =
215226
marathonMatchAnalyticsService.getMarathonMatchListings("active", null, null, 50, 1, null, null,
216227
MarathonMatchHelper.ACCESS_TOKEN);
228+
} catch (Exception e) {
229+
LoggingWrapperUtility.logException(logger, "isMarathonMatchActive", e);
230+
return false;
231+
}
217232
boolean active = false;
218233
for(MarathonMatchItemResource contestItem : activeContests.getItems()) {
219234
if(contestItem.getRoundId() == roundId) {

0 commit comments

Comments
 (0)