Fix metadata exception handler #2 (#3357)

This commit is contained in:
Weiko
2024-01-10 17:02:54 +01:00
committed by GitHub
parent 4f9ea78258
commit 22047fa2bf
9 changed files with 17 additions and 24 deletions

View File

@ -1,4 +1,4 @@
import { Injectable } from '@nestjs/common';
import { BadRequestException, Injectable } from '@nestjs/common';
import { InjectRepository } from '@nestjs/typeorm';
import { FindManyOptions, FindOneOptions, Repository } from 'typeorm';
@ -59,7 +59,7 @@ export class ObjectMetadataService extends TypeOrmQueryService<ObjectMetadataEnt
objectMetadataInput.nameSingular.toLowerCase() ===
objectMetadataInput.namePlural.toLowerCase()
) {
throw new Error(
throw new BadRequestException(
'The singular and plural name cannot be the same for an object',
);
}