@@ -37,8 +37,8 @@ if (config.TC_DEV_ENV) {
37
37
topcoderApiProjects = topcoderDevApiProjects ;
38
38
topcoderApiChallenges = topcoderDevApiChallenges ;
39
39
}
40
- //Timeout increase to 5 minutes
41
- topcoderApiChallenges . ApiClient . timeout = 300000 ;
40
+ // Timeout increase to 5 minutes
41
+ topcoderApiChallenges . ApiClient . timeout = 300000 ;
42
42
43
43
// Init the API instances
44
44
const projectsClient = topcoderApiProjects . ApiClient . instance ;
@@ -157,6 +157,12 @@ async function updateChallenge(id, challenge) {
157
157
const statusCode = response . result ? response . result . status : null ;
158
158
loggerFile . info ( `EndPoint: PUT /challenges/${ id } , PUT parameters: null, Status Code:${ statusCode } , Response: ${ circularJSON . stringify ( response ) } ` ) ;
159
159
} catch ( err ) {
160
+ logger . error ( 'updateChallenge ERROR.' ) ;
161
+ logger . error ( `EndPoint: PUT /challenges/${ id } ` ) ;
162
+ logger . error ( `${ err . message } ` ) ;
163
+ logger . error ( `Request: ${ JSON . stringify ( err . config ) } ` ) ;
164
+ logger . error ( `Response Data: ${ err . response . data } ` ) ;
165
+
160
166
loggerFile . info ( `EndPoint: PUT /challenges/${ id } , PUT parameters: null, Status Code:null,
161
167
Error: 'Failed to update challenge.', Details: ${ circularJSON . stringify ( err ) } ` ) ;
162
168
throw errors . convertTopcoderApiError ( err , 'Failed to update challenge.' ) ;
@@ -187,6 +193,12 @@ async function activateChallenge(id) {
187
193
POST parameters: null, Status Code:${ statusCode } , Response: ${ circularJSON . stringify ( response ) } ` ) ;
188
194
logger . debug ( `Challenge ${ id } is activated successfully.` ) ;
189
195
} catch ( err ) {
196
+ logger . error ( 'activateChallenge ERROR.' ) ;
197
+ logger . error ( `EndPoint: POST /challenges/${ id } /activate` ) ;
198
+ logger . error ( `${ err . message } ` ) ;
199
+ logger . error ( `Request: ${ JSON . stringify ( err . config ) } ` ) ;
200
+ logger . error ( `Response Data: ${ err . response . data } ` ) ;
201
+
190
202
loggerFile . info ( `EndPoint: POST /challenges/${ id } /activate, POST parameters: null, Status Code:null,
191
203
Error: 'Failed to activate challenge.', Details: ${ circularJSON . stringify ( err ) } ` ) ;
192
204
throw errors . convertTopcoderApiError ( err , 'Failed to activate challenge.' ) ;
@@ -216,6 +228,13 @@ async function getChallengeById(id) {
216
228
loggerFile . info ( `EndPoint: GET challenges/${ id } , GET parameters: null, Status Code:${ statusCode } , Response: ${ circularJSON . stringify ( response ) } ` ) ;
217
229
return challenge ;
218
230
} catch ( err ) {
231
+ logger . error ( 'getChallengeById ERROR.' ) ;
232
+ logger . error ( `EndPoint: GET challenges/${ id } ` ) ;
233
+ logger . error ( `${ err . message } ` ) ;
234
+ logger . error ( `Request: ${ JSON . stringify ( err . config ) } ` ) ;
235
+ logger . error ( `Response Data: ${ err . response . data } ` ) ;
236
+
237
+ logger . error ( JSON . stringify ( err ) ) ;
219
238
throw errors . convertTopcoderApiError ( err , 'Failed to get challenge details by Id' ) ;
220
239
}
221
240
}
@@ -239,6 +258,11 @@ async function closeChallenge(id, winnerId) {
239
258
loggerFile . info ( `EndPoint: POST /challenges/${ id } /close, POST parameters: null, Status Code:${ statusCode } , Response:${ circularJSON . stringify ( response ) } ` ) ;
240
259
logger . debug ( `Challenge ${ id } is closed successfully.` ) ;
241
260
} catch ( err ) {
261
+ logger . error ( 'Closing challenge ERROR.' ) ;
262
+ logger . error ( `EndPoint: POST /challenges/${ id } /close` ) ;
263
+ logger . error ( `${ err . message } ` ) ;
264
+ logger . error ( `Request: ${ JSON . stringify ( err . config ) } ` ) ;
265
+ logger . error ( `Response Data: ${ err . response . data } ` ) ;
242
266
loggerFile . info ( `EndPoint: POST /challenges/${ id } /close, POST parameters: null, Status Code:null,
243
267
Error: 'Failed to close challenge.', Details: ${ circularJSON . stringify ( err ) } ` ) ;
244
268
throw errors . convertTopcoderApiError ( err , 'Failed to close challenge.' ) ;
0 commit comments