|
3 | 3 | */ |
4 | 4 | package com.topcoder.direct.services.view.action.analytics.longcontest; |
5 | 5 |
|
| 6 | +import com.topcoder.commons.utils.LoggingWrapperUtility; |
6 | 7 | import com.topcoder.direct.services.view.action.analytics.longcontest.services.MarathonMatchAnalyticsService; |
7 | 8 | import com.topcoder.direct.services.view.action.analytics.longcontest.services.MarathonMatchAnalyticsServiceException; |
8 | 9 | import com.topcoder.direct.services.view.dto.contest.BaseContestCommonDTO; |
|
24 | 25 | import com.topcoder.web.tc.rest.longcontest.resources.MatchResultResource; |
25 | 26 | import com.topcoder.web.tc.rest.longcontest.resources.ProgressResource; |
26 | 27 | import com.topcoder.web.tc.rest.longcontest.resources.SearchResult; |
| 28 | +import com.topcoder.util.log.Log; |
| 29 | +import com.topcoder.util.log.LogManager; |
27 | 30 | import org.codehaus.jackson.map.ObjectMapper; |
28 | 31 | import org.codehaus.jackson.node.ArrayNode; |
29 | 32 | import org.codehaus.jackson.node.ObjectNode; |
@@ -101,6 +104,11 @@ public final class MarathonMatchHelper { |
101 | 104 | */ |
102 | 105 | public static final String GROUP_TYPE_DAY = "day"; |
103 | 106 |
|
| 107 | + /** |
| 108 | + * Log instance. |
| 109 | + */ |
| 110 | + private static final Log logger = LogManager.getLog(MarathonMatchHelper.class.getName()); |
| 111 | + |
104 | 112 | /** |
105 | 113 | * Get the marathon match details information of this marathon match contest. |
106 | 114 | * |
@@ -211,9 +219,16 @@ public int compare(CompetitorResource competitorResource, CompetitorResource com |
211 | 219 | */ |
212 | 220 | public static boolean isMarathonMatchActive(Long roundId, |
213 | 221 | MarathonMatchAnalyticsService marathonMatchAnalyticsService) throws MarathonMatchAnalyticsServiceException { |
214 | | - SearchResult<MarathonMatchItemResource> activeContests = |
| 222 | + SearchResult<MarathonMatchItemResource> activeContests = null; |
| 223 | + |
| 224 | + try { |
| 225 | + activeContests = |
215 | 226 | marathonMatchAnalyticsService.getMarathonMatchListings("active", null, null, 50, 1, null, null, |
216 | 227 | MarathonMatchHelper.ACCESS_TOKEN); |
| 228 | + } catch (Exception e) { |
| 229 | + LoggingWrapperUtility.logException(logger, "isMarathonMatchActive", e); |
| 230 | + return false; |
| 231 | + } |
217 | 232 | boolean active = false; |
218 | 233 | for(MarathonMatchItemResource contestItem : activeContests.getItems()) { |
219 | 234 | if(contestItem.getRoundId() == roundId) { |
|
0 commit comments