File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -76,11 +76,22 @@ function finishLog<SLocals extends AnyServiceLocals = ServiceLocals<Configuratio
7676
7777 const dur = hrdur [ 0 ] + hrdur [ 1 ] / 1000000000 ;
7878 const [ url , preInfo ] = getBasicInfo ( req ) ;
79+
80+ let responseType : string = 'finished' ;
81+
82+ // ts warning is known and incorrect—`aborted` is a subset of `destroyed`
83+ if ( req . aborted ) {
84+ responseType = 'aborted' ;
85+ } else if ( req . destroyed ) {
86+ responseType = 'destroyed' ;
87+ } else if ( error ) {
88+ responseType = 'errored' ;
89+ }
90+
7991 const endLog : Record < string , string | string [ ] | number | undefined > = {
8092 ...preInfo ,
8193 t : 'req' ,
82- // ts warning is known and incorrect—`aborted` is a subset of `destroyed``
83- r : req . aborted ? 'aborted' : req . destroyed ? 'destroyed' : error ? 'errored' : 'finished' ,
94+ r : responseType ,
8495 s : ( error as ErrorWithStatus ) ?. status || res . statusCode || 0 ,
8596 dur,
8697 } ;
You can’t perform that action at this time.
0 commit comments