@@ -50,7 +50,7 @@ async function handleEventGracefully(event, data, err) {
50
50
// reschedule event
51
51
if ( event . retryCount < config . RETRY_COUNT ) {
52
52
logger . debug ( 'Scheduling event for next retry' ) ;
53
- const newEvent = { ...event } ;
53
+ const newEvent = { ...event } ;
54
54
newEvent . retryCount += 1 ;
55
55
delete newEvent . copilot ;
56
56
const timeoutKey = setTimeout ( async ( ) => {
@@ -77,13 +77,18 @@ async function handleEventGracefully(event, data, err) {
77
77
comment = `The challenge cancel failed: ${ comment } ` ;
78
78
}
79
79
} else if ( event . event === 'issue.created' ) {
80
- // comment for challenge creation failed
81
- comment = 'The challenge creation on the Topcoder platform failed. Please contact support to try again' ;
80
+ if ( err . name === 'ProcessorError' && err . statusCode && err . message ) {
81
+ // comment for challenge creation failed
82
+ comment = `[${ err . statusCode } ]: ${ err . message } `
83
+ } else {
84
+ // comment for challenge creation failed
85
+ comment = 'The challenge creation on the Topcoder platform failed. Please contact support to try again' ;
86
+ }
82
87
} else if ( event . event === 'copilotPayment.add' ) {
83
88
// comment for copilot payment challenge create failed
84
89
comment = 'The copilot payment challenge creation on the Topcoder platform failed. Please contact support to try again' ;
85
90
await dbHelper . remove ( models . CopilotPayment , {
86
- id : { eq : data . id }
91
+ id : { eq : data . id }
87
92
} ) ;
88
93
// we dont need to put comment for copilot payment
89
94
return ;
0 commit comments