File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
libs/core/prisma-tools/src/lib Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -21,9 +21,9 @@ export class PrismaToolsService {
21
21
// eslint-disable-next-line @typescript-eslint/no-explicit-any
22
22
convertPrismaErrorToDbError ( exception : any ) {
23
23
try {
24
- const stacktrace = String ( exception ?. stack )
25
- . split ( `${ __dirname } /webpack:/${ basename ( __dirname ) } /` )
26
- . join ( '' ) ;
24
+ const stacktrace = String ( exception ?. stack || exception )
25
+ ? .split ( `${ __dirname } /webpack:/${ basename ( __dirname ) } /` )
26
+ ? .join ( '' ) ;
27
27
const originalError = Object . assign ( new Error ( ) , { stack : stacktrace } ) ;
28
28
29
29
if ( String ( exception ?. name ) . startsWith ( 'PrismaClient' ) || String ( exception ?. code ) . startsWith ( 'P' ) ) {
@@ -47,7 +47,7 @@ export class PrismaToolsService {
47
47
originalError,
48
48
} ;
49
49
}
50
- const relatedTable = exception . meta ?. [ 'cause' ] . split ( `'` ) [ 1 ] ;
50
+ const relatedTable = exception . meta ?. [ 'cause' ] ? .split ( `'` ) ?. [ 1 ] ;
51
51
if ( relatedTable && exception . meta ?. [ 'modelName' ] ) {
52
52
this . logger . debug ( {
53
53
modelName : exception . meta ?. [ 'modelName' ] ,
You can’t perform that action at this time.
0 commit comments