Skip to content

Commit

Permalink
fallback values on statusText. (#268)
Browse files Browse the repository at this point in the history
Co-authored-by: August Andersen <[email protected]>
  • Loading branch information
augusthjerrild and August Andersen authored Sep 25, 2024
1 parent 9678b11 commit e79f365
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/services/data-targets/data-target-log.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { IoTDevice } from "@entities/iot-device.entity";
import { PayloadDecoder } from "@entities/payload-decoder.entity";
import { SendStatus } from "@enum/send-status.enum";
import { DataTargetSendStatus } from "@interfaces/data-target-send-status.interface";
import { Injectable } from "@nestjs/common";
import { HttpStatus, Injectable } from "@nestjs/common";
import { ConfigService } from "@nestjs/config";
import { InjectRepository } from "@nestjs/typeorm";
import { In, MoreThan, Repository } from "typeorm";
Expand Down Expand Up @@ -35,11 +35,12 @@ export class DataTargetLogService {
});
if (datatargetLastestEvent?.type !== SendStatus.ERROR) return;
}

await this.handleDataTargetLogCommon(
datatarget,
status?.status,
status?.statusCode,
status?.statusText,
status?.statusText ?? (status?.statusCode ? HttpStatus[status?.statusCode] : status.errorMessage),
payloadDto?.iotDeviceId,
payloadDto?.payloadDecoderId
);
Expand Down

0 comments on commit e79f365

Please sign in to comment.