Skip to content

Commit 273da5a

Browse files
authored
Adding 1016 as retryable and default to 500 (#3698)
* Adding 1016 as retryable and default to 500 * default to 500 in non batched deliveries * default to 500 in non batched deliveries
1 parent b04de04 commit 273da5a

2 files changed

Lines changed: 16 additions & 15 deletions

File tree

packages/destination-actions/src/destinations/marketo-static-lists/__tests__/multistatus.test.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -126,15 +126,15 @@ describe('MultiStatus', () => {
126126

127127
expect(response).toMatchObject([
128128
{
129-
status: 406,
130-
errortype: 'NOT_ACCEPTABLE',
129+
status: 500,
130+
errortype: 'RETRYABLE_ERROR',
131131
errormessage: 'Invalid Content Type',
132132
errorreporter: 'DESTINATION',
133133
body: { code: '612', message: 'Invalid Content Type' }
134134
},
135135
{
136-
status: 406,
137-
errortype: 'NOT_ACCEPTABLE',
136+
status: 500,
137+
errortype: 'RETRYABLE_ERROR',
138138
errormessage: 'Invalid Content Type',
139139
errorreporter: 'DESTINATION',
140140
body: { code: '612', message: 'Invalid Content Type' }
@@ -354,15 +354,15 @@ describe('MultiStatus', () => {
354354

355355
expect(response).toMatchObject([
356356
{
357-
status: 406,
358-
errortype: 'NOT_ACCEPTABLE',
357+
status: 500,
358+
errortype: 'RETRYABLE_ERROR',
359359
errormessage: 'Invalid Content Type',
360360
errorreporter: 'DESTINATION',
361361
body: { code: '612', message: 'Invalid Content Type' }
362362
},
363363
{
364-
status: 406,
365-
errortype: 'NOT_ACCEPTABLE',
364+
status: 500,
365+
errortype: 'RETRYABLE_ERROR',
366366
errormessage: 'Invalid Content Type',
367367
errorreporter: 'DESTINATION',
368368
body: { code: '612', message: 'Invalid Content Type' }
@@ -398,15 +398,15 @@ describe('MultiStatus', () => {
398398

399399
expect(response).toMatchObject([
400400
{
401-
status: 406,
402-
errortype: 'NOT_ACCEPTABLE',
401+
status: 500,
402+
errortype: 'RETRYABLE_ERROR',
403403
errormessage: 'Invalid Content Type',
404404
errorreporter: 'DESTINATION',
405405
body: { code: '612', message: 'Invalid Content Type' }
406406
},
407407
{
408-
status: 406,
409-
errortype: 'NOT_ACCEPTABLE',
408+
status: 500,
409+
errortype: 'RETRYABLE_ERROR',
410410
errormessage: 'Invalid Content Type',
411411
errorreporter: 'DESTINATION',
412412
body: { code: '612', message: 'Invalid Content Type' }

packages/destination-actions/src/destinations/marketo-static-lists/functions.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,7 @@ const MARKETO_RETRYABLE_CODES = new Set([
332332
'713', // Transient error – system resource temporarily unavailable
333333
'719', // Lock wait timeout
334334
'1019', // Batch import in progress on list
335+
'1016', // Too many imports in progress
335336
'1029' // Queue/export limit exceeded
336337
])
337338

@@ -354,7 +355,7 @@ function parseErrorResponse(response: MarketoResponse) {
354355
throw new RetryableError(message)
355356
}
356357

357-
throw new IntegrationError(message, ErrorCodes.NOT_ACCEPTABLE, 406)
358+
throw new IntegrationError(message, ErrorCodes.RETRYABLE_ERROR, 500)
358359
}
359360

360361
function parseErrorResponseBatch(response: MarketoResponse, payloadSize: number) {
@@ -384,8 +385,8 @@ function parseErrorResponseBatch(response: MarketoResponse, payloadSize: number)
384385
}
385386

386387
return buildMultiStatusErrorResponse(payloadSize, {
387-
status: 406,
388-
errortype: ErrorCodes.NOT_ACCEPTABLE,
388+
status: 500,
389+
errortype: ErrorCodes.RETRYABLE_ERROR,
389390
body: response.errors[0] as unknown as JSONLikeObject,
390391
errormessage: message
391392
})

0 commit comments

Comments
 (0)