added exception filter and removed controller error handling

This commit is contained in:
unknown
2024-10-06 11:04:25 +03:00
26 changed files with 780 additions and 1345 deletions

View File

@ -1,4 +1,4 @@
import { Controller, Get, HttpException, HttpStatus } from '@nestjs/common';
import { Controller, Get } from '@nestjs/common';
import { RegionService } from '../services/region.service';
import { ApiTags, ApiOperation } from '@nestjs/swagger';
import { ControllerRoute } from '@app/common/constants/controller-route';
@ -17,13 +17,6 @@ export class RegionController {
description: ControllerRoute.REGION.ACTIONS.GET_REGIONS_DESCRIPTION,
})
async getAllRegions() {
try {
return await this.regionService.getAllRegions();
} catch (error) {
throw new HttpException(
error.message || 'Internal server error',
error.status || HttpStatus.INTERNAL_SERVER_ERROR,
);
}
return await this.regionService.getAllRegions();
}
}