- Add DomainException base class extending HttpException - Add EntityNotFoundException, PortfolioAccessDeniedException, MoexApiException, TBankApiException, TBankNotConfiguredException - Update HttpExceptionFilter with unhandled error logging - Replace generic NestJS exceptions in services with domain exceptions - Update all affected tests - 117 tests pass, build succeeds
9 lines
284 B
TypeScript
9 lines
284 B
TypeScript
import { HttpStatus } from '@nestjs/common';
|
|
import { DomainException } from './domain.exception';
|
|
|
|
export class EntityNotFoundException extends DomainException {
|
|
constructor(entity: string, id: string | number) {
|
|
super(`${entity} ${id} not found`, HttpStatus.NOT_FOUND);
|
|
}
|
|
}
|