Skip to content

Commit

Permalink
fixed the logging issue
Browse files Browse the repository at this point in the history
  • Loading branch information
abhimanyubabbar committed Mar 12, 2024
1 parent 0e9ada9 commit ee4e81f
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions src/services/trackingPlan.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export class TrackingPlanservice {
const startTime = new Date();

Check warning on line 10 in src/services/trackingPlan.ts

View check run for this annotation

Codecov / codecov/patch

src/services/trackingPlan.ts#L9-L10

Added lines #L9 - L10 were not covered by tests
const respList: any[] = [];
const metaTags = events.length && events[0].metadata ? getMetadata(events[0].metadata) : {};
const tpTags =
const tpTags: any =
events.length && events[0].metadata ? getTrackingPlanMetadata(events[0].metadata) : {};
let ctxStatusCode = 200;

Expand All @@ -31,17 +31,15 @@ export class TrackingPlanservice {
validationErrors: validatedEvent['validationErrors'],
error: JSON.stringify(constructValidationErrors(validatedEvent['validationErrors'])),
};
} catch (error) {
} catch (error: any) {
logger.debug(

Check warning on line 35 in src/services/trackingPlan.ts

View check run for this annotation

Codecov / codecov/patch

src/services/trackingPlan.ts#L35

Added line #L35 was not covered by tests
`Error occurred while validating event`,
'event',
event?.eventName,
'tp',
event?.trackingPlanId,
'tpVersion',
event?.trackingPlanVersion,
`${event.message?.event}::${event.message?.type}`,
'trackingPlan',
`${tpTags?.trackingPlanId}`,
'error',
error,
error.message,
);

exceptionOccured = true;

Check warning on line 45 in src/services/trackingPlan.ts

View check run for this annotation

Codecov / codecov/patch

src/services/trackingPlan.ts#L45

Added line #L45 was not covered by tests
Expand Down

0 comments on commit ee4e81f

Please sign in to comment.