mirror of
https://github.com/SyncrowIOT/backend.git
synced 2026-10-23 09:07:54 +00:00
throw appropriate error
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user