1
- /* eslint-disable @typescript-eslint/no-unsafe-call */
2
1
import { KinesisStreamEvent } from 'aws-lambda' ;
3
2
import { injectable , inject , multiInject } from 'inversify' ;
4
3
import { Parser } from './types/parser' ;
5
4
import { TYPES } from './inversify.types' ;
6
5
import { LoggerService } from './util/logger.service' ;
7
6
import { GenericError } from './util/generic.error' ;
8
- // eslint-disable-next-line max-len
7
+
9
8
import {
10
9
OsDocument ,
11
10
KinesisStreamRecordDecodeFailure ,
@@ -81,6 +80,10 @@ export class EcsTransformService {
81
80
} catch ( error : unknown ) {
82
81
const parser : string =
83
82
error instanceof ParserError ? error . parser : 'unknown' ;
83
+ const skipDlq : boolean =
84
+ error instanceof ParserError && error . options
85
+ ? error . options . skipDlq
86
+ : false ;
84
87
const message : string =
85
88
error instanceof ParserError || error instanceof GenericError
86
89
? error . message
@@ -100,14 +103,13 @@ export class EcsTransformService {
100
103
const path : string = document . data . log ?. file ?. path
101
104
? document . data . log ?. file ?. path
102
105
: '' ;
103
- // eslint-disable-next-line max-len
104
106
this . logger . debug (
105
107
`PARSE_ERROR:${ parser } ${ team } ${ hostName } ${ serviceName } ${ path } :${ sequence } ${ document . fingerprint . name } : ${ message } ` ,
106
108
) ;
107
109
return new OsDocumentProcessingFailure (
108
110
document ,
109
- // eslint-disable-next-line max-len
110
111
`PARSE_ERROR:${ parser } ${ team } ${ hostName } ${ serviceName } ${ path } :${ sequence } ${ document . fingerprint . name } : ${ message } ` ,
112
+ { skipDlq } ,
111
113
) ;
112
114
}
113
115
} )
0 commit comments