Skip to content

Commit

Permalink
fix: Prevent logging events from always returning true (#18)
Browse files Browse the repository at this point in the history
  • Loading branch information
rmi22186 authored Sep 29, 2023
1 parent 8df34d0 commit 7ae86a0
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,7 @@ var constructor = function() {

function logSessionStart(event) {
try {
SessionHandler.onSessionStart(event);
return true;
return SessionHandler.onSessionStart(event);
} catch (e) {
return {
error: 'Error starting session on forwarder ' + name + '; ' + e,
Expand All @@ -150,8 +149,7 @@ var constructor = function() {

function logSessionEnd(event) {
try {
SessionHandler.onSessionEnd(event);
return true;
return SessionHandler.onSessionEnd(event);
} catch (e) {
return {
error: 'Error ending session on forwarder ' + name + '; ' + e,
Expand All @@ -161,8 +159,7 @@ var constructor = function() {

function logError(event) {
try {
self.eventHandler.logError(event);
return true;
return self.eventHandler.logError(event);
} catch (e) {
return {
error: 'Error logging error on forwarder ' + name + '; ' + e,
Expand All @@ -172,8 +169,7 @@ var constructor = function() {

function logPageView(event) {
try {
self.eventHandler.logPageView(event);
return true;
return self.eventHandler.logPageView(event);
} catch (e) {
return {
error:
Expand All @@ -184,8 +180,7 @@ var constructor = function() {

function logEvent(event) {
try {
self.eventHandler.logEvent(event);
return true;
return self.eventHandler.logEvent(event);
} catch (e) {
return {
error: 'Error logging event on forwarder ' + name + '; ' + e,
Expand All @@ -195,8 +190,7 @@ var constructor = function() {

function logEcommerceEvent(event) {
try {
self.commerceHandler.logCommerceEvent(event);
return true;
return self.commerceHandler.logCommerceEvent(event);
} catch (e) {
return {
error:
Expand Down

0 comments on commit 7ae86a0

Please sign in to comment.