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
76
76
77
77
const dur = hrdur [ 0 ] + hrdur [ 1 ] / 1000000000 ;
78
78
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
+
79
91
const endLog : Record < string , string | string [ ] | number | undefined > = {
80
92
...preInfo ,
81
93
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 ,
84
95
s : ( error as ErrorWithStatus ) ?. status || res . statusCode || 0 ,
85
96
dur,
86
97
} ;
You can’t perform that action at this time.
0 commit comments