diff --git a/src/transaction/transaction.service.ts b/src/transaction/transaction.service.ts index c811487..18ffb86 100644 --- a/src/transaction/transaction.service.ts +++ b/src/transaction/transaction.service.ts @@ -2220,12 +2220,7 @@ export class TransactionService { - if (!data) { - return { - statusCode: HttpStatus.NOT_FOUND, - message: 'No data to export' - }; - } else { + try { let rows = []; // First create the array of keys/net_total so that we can sort it: @@ -2325,6 +2320,8 @@ export class TransactionService { //returning the path of file return File; + } catch (e) { + throw new HttpException('No data to export', HttpStatus.NOT_FOUND); } }