mirror of
https://github.com/SyncrowIOT/backend.git
synced 2025-11-26 21:24:53 +00:00
added exception filter and removed controller error handling
This commit is contained in:
@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user