File tree 1 file changed +4
-5
lines changed
libs/json-api/json-api-nestjs/src/lib/modules/mixin/service
1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -5,13 +5,12 @@ import {
5
5
InternalServerErrorException ,
6
6
} from '@nestjs/common' ;
7
7
import { MODULE_OPTIONS_TOKEN } from '../../../constants' ;
8
- import { EntityControllerParam } from '../types' ;
9
- import { ValidateQueryError } from '../../../types' ;
8
+ import { PrepareParams , ValidateQueryError } from '../../../types' ;
10
9
import { HttpExceptionOptions } from '@nestjs/common/exceptions/http.exception' ;
11
10
12
11
@Injectable ( )
13
12
export class ErrorFormatService {
14
- @Inject ( MODULE_OPTIONS_TOKEN ) private config ! : EntityControllerParam ;
13
+ @Inject ( MODULE_OPTIONS_TOKEN ) private config ! : PrepareParams ;
15
14
private defaultErrorMsg = 'Internal Server Error' ;
16
15
formatError ( error : unknown ) : HttpException {
17
16
if ( error instanceof HttpException ) {
@@ -20,7 +19,7 @@ export class ErrorFormatService {
20
19
21
20
const errMessage =
22
21
error instanceof Error
23
- ? this . config . debug
22
+ ? this . config . options . debug
24
23
? error . message
25
24
: this . defaultErrorMsg
26
25
: this . defaultErrorMsg ;
@@ -31,7 +30,7 @@ export class ErrorFormatService {
31
30
path : [ ] ,
32
31
} ;
33
32
34
- const descriptionOrOptions : HttpExceptionOptions = this . config . debug
33
+ const descriptionOrOptions : HttpExceptionOptions = this . config . options . debug
35
34
? {
36
35
description : this . defaultErrorMsg ,
37
36
cause : error instanceof Error ? error : undefined ,
You can’t perform that action at this time.
0 commit comments