File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed
Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,6 @@ import { DestinationMetadataEnrichment } from './DestinationMetadataEnrichment';
1313import { QueueFlushingPlugin } from './QueueFlushingPlugin' ;
1414import { defaultApiHost , defaultConfig } from '../constants' ;
1515import {
16- checkResponseForErrors ,
1716 translateHTTPError ,
1817 classifyError ,
1918 parseRetryAfter ,
@@ -97,7 +96,12 @@ export class SegmentDestination extends DestinationPlugin {
9796 : undefined ;
9897
9998 // Classify error
100- const classification = classifyError ( res . status , config . httpConfig ) ;
99+ const classification = classifyError ( res . status , {
100+ default4xxBehavior : config . httpConfig ?. backoffConfig ?. default4xxBehavior ,
101+ default5xxBehavior : config . httpConfig ?. backoffConfig ?. default5xxBehavior ,
102+ statusCodeOverrides : config . httpConfig ?. backoffConfig ?. statusCodeOverrides ,
103+ rateLimitEnabled : config . httpConfig ?. rateLimitConfig ?. enabled ,
104+ } ) ;
101105
102106 if ( classification . errorType === 'rate_limit' ) {
103107 return {
Original file line number Diff line number Diff line change @@ -151,6 +151,7 @@ export type Config = {
151151 cdnProxy ?: string ;
152152 useSegmentEndpoints ?: boolean ; // Use if you want to use Segment endpoints
153153 errorHandler ?: ( error : SegmentError ) => void ;
154+ httpConfig ?: HttpConfig ;
154155} ;
155156
156157export type ClientMethods = {
You can’t perform that action at this time.
0 commit comments