File tree Expand file tree Collapse file tree 2 files changed +9
-13
lines changed
src/management/identities Expand file tree Collapse file tree 2 files changed +9
-13
lines changed Original file line number Diff line number Diff line change @@ -46,17 +46,13 @@ export abstract class AbstractIdentitiesService extends AbstractServiceSchema {
4646 }
4747
4848 if ( error instanceof ValidationSchemaException ) {
49- this . logger . warn ( `${ logPrefix } Validation schema error. ${ JSON . stringify ( error . getValidations ( ) ) } ` ) ;
50- identity . additionalFields . validations = error . getValidations ( ) as any ;
51- // console.log('identity.state', identity.state)
52- if ( identity . state === IdentityState . TO_CREATE ) {
53- this . logger . warn ( `${ logPrefix } State set to TO_COMPLETE.` ) ;
54- identity . state = IdentityState . TO_COMPLETE ;
55- return identity ;
56- } else {
57- this . logger . error ( `${ logPrefix } Validation schema error. ${ JSON . stringify ( error . getValidations ( ) ) } ` ) ;
58- throw new ValidationSchemaException ( error . getPayload ( ) ) ;
59- }
49+ this . logger . warn ( `${ logPrefix } Validation handleValidationError schema error. ${ JSON . stringify ( error . getValidations ( ) ) } ` ) ;
50+ identity . additionalFields . validations = error . getValidations ( ) ;
51+
52+ this . logger . warn ( `${ logPrefix } State set to TO_COMPLETE.` ) ;
53+ identity . state = IdentityState . TO_COMPLETE ;
54+
55+ return identity ;
6056 } else {
6157 this . logger . error ( `${ logPrefix } Unhandled error: ${ error . message } ` ) ;
6258 throw error ; // Rethrow the original error if it's not one of the handled types.
Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ export class IdentitiesCrudService extends AbstractIdentitiesService {
3737 throw new ValidationConfigException ( error . getPayload ( ) ) ;
3838 }
3939 if ( error instanceof ValidationSchemaException ) {
40- this . logger . warn ( `${ logPrefix } Validation schema error. ${ JSON . stringify ( error . getValidations ( ) ) } ` ) ;
40+ this . logger . warn ( `${ logPrefix } Validation create schema error. ${ JSON . stringify ( error . getValidations ( ) ) } ` ) ;
4141 data . additionalFields . validations = error . getValidations ( ) ;
4242 throw new ValidationSchemaException ( error . getPayload ( ) ) ;
4343 } else {
@@ -100,7 +100,7 @@ export class IdentitiesCrudService extends AbstractIdentitiesService {
100100 throw new ValidationConfigException ( error . getPayload ( ) ) ;
101101 }
102102 if ( error instanceof ValidationSchemaException ) {
103- this . logger . warn ( `${ logPrefix } Validation schema error. ${ JSON . stringify ( error . getValidations ( ) ) } ` ) ;
103+ this . logger . warn ( `${ logPrefix } Validation update schema error. ${ JSON . stringify ( error . getValidations ( ) ) } ` ) ;
104104 update . additionalFields . validations = error . getValidations ( ) ;
105105 throw new ValidationSchemaException ( error . getPayload ( ) ) ;
106106 } else {
You can’t perform that action at this time.
0 commit comments