Skip to content

Commit 7c2686d

Browse files
committed
✨ add logs for the payload of the request upon error
1 parent 65759e9 commit 7c2686d

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

src/models/controller.model.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,7 @@ export class Controller {
222222
apiKey,
223223
error || "Unknown"
224224
);
225+
errorLogger("createContact", "Entity", apiKey, req.body);
225226
next(error);
226227
}
227228
}
@@ -301,6 +302,7 @@ export class Controller {
301302
apiKey,
302303
error || "Unknown"
303304
);
305+
errorLogger("updateContact", "Entity", apiKey, req.body);
304306
next(error);
305307
}
306308
}
@@ -486,6 +488,7 @@ export class Controller {
486488
apiKey,
487489
error || "Unknown"
488490
);
491+
errorLogger("createCalendarEvent", "Entity", apiKey, req.body);
489492
next(error);
490493
}
491494
}
@@ -540,6 +543,7 @@ export class Controller {
540543
apiKey,
541544
error || "Unknown"
542545
);
546+
errorLogger("updateCalendarEvent", "Entity", apiKey, req.body);
543547
next(error);
544548
}
545549
}
@@ -638,6 +642,12 @@ export class Controller {
638642
providerConfig?.apiKey,
639643
error || "Unknown"
640644
);
645+
errorLogger(
646+
"handleCallEvent",
647+
"Entity",
648+
providerConfig?.apiKey,
649+
req.body
650+
);
641651
next(error);
642652
}
643653
}
@@ -696,6 +706,12 @@ export class Controller {
696706
providerConfig?.apiKey,
697707
error || "Unknown"
698708
);
709+
errorLogger(
710+
"createCallLogForEntities",
711+
"Entity",
712+
providerConfig?.apiKey,
713+
req.body
714+
);
699715
next(error);
700716
}
701717
}
@@ -775,6 +791,7 @@ export class Controller {
775791
apiKey,
776792
error || "Unknown"
777793
);
794+
errorLogger("handleConnectedEvent", "Entity", apiKey, req.body);
778795
next(error);
779796
}
780797
}
@@ -807,6 +824,7 @@ export class Controller {
807824
apiKey,
808825
error || "Unknown"
809826
);
827+
errorLogger("updateCallEvent", "Entity", apiKey, req.body);
810828
next(error);
811829
}
812830
}

0 commit comments

Comments
 (0)