throw appropriate error

This commit is contained in:
hannathkadher
2025-04-24 12:55:49 +04:00
parent e98633749d
commit f9e1219f55
+6
View File
@@ -582,6 +582,9 @@ export class DeviceService {
return { successResults, failedResults };
} catch (error) {
if (error instanceof HttpException) {
throw error;
}
throw new HttpException(
error.message || 'Device Not Found',
error.status || HttpStatus.NOT_FOUND,
@@ -1116,6 +1119,9 @@ export class DeviceService {
});
}
} catch (error) {
if (error instanceof HttpException) {
throw error;
}
throw new HttpException(
error.message || 'Internal server error',
HttpStatus.INTERNAL_SERVER_ERROR,