File tree Expand file tree Collapse file tree 1 file changed +2
-4
lines changed Expand file tree Collapse file tree 1 file changed +2
-4
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ import * as stacktrace from 'stack-trace';
10
10
import { MESSAGE } from 'triple-beam' ;
11
11
import { fileURLToPath } from 'url' ;
12
12
import { config , format , LogEntry } from 'winston' ;
13
- import { Exception } from '../../ common/exceptions ' ;
13
+ import { hasPrevious } from '~/ common' ;
14
14
import { maskSecrets as maskSecretsOfObj } from '../../common/mask-secrets' ;
15
15
import { getNameFromEntry } from './logger.interface' ;
16
16
@@ -77,9 +77,7 @@ export const exceptionInfo = () =>
77
77
delete info . stack ;
78
78
79
79
const flatten = ( ex : Error ) : Error [ ] =>
80
- ex instanceof Exception && ex . previous
81
- ? [ ex , ...flatten ( ex . previous ) ]
82
- : [ ex ] ;
80
+ hasPrevious ( ex ) ? [ ex , ...flatten ( ex . previous ) ] : [ ex ] ;
83
81
84
82
info . exceptions = flatten ( info . exception ) . map ( ( ex ) : ParsedError => {
85
83
const { name : _ , message, stack : __ , ...other } = ex ;
You can’t perform that action at this time.
0 commit comments