Skip to content

Commit

Permalink
Merge pull request #32 from Microsoft/scripterror
Browse files Browse the repository at this point in the history
dumping errors nicely
  • Loading branch information
MaxShehovtsov committed Jul 15, 2015
2 parents 8de88d4 + 3f170ed commit 0a8d140
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion JavaScript/JavaScriptSDK/Context/Session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ module Microsoft.ApplicationInsights.Context {
this.automaticSession.renewalDate = this.automaticSession.renewalDate > 0 ? this.automaticSession.renewalDate : 0;
}
} catch (e) {
_InternalLogging.throwInternalNonUserActionable(LoggingSeverity.WARNING, "Error parsing ai_session cookie, session will be reset: " + JSON.stringify(e));
_InternalLogging.throwInternalNonUserActionable(LoggingSeverity.WARNING, "Error parsing ai_session cookie, session will be reset: " + Util.dump(e));
}

if (this.automaticSession.renewalDate == 0) {
Expand Down
4 changes: 2 additions & 2 deletions JavaScript/JavaScriptSDK/Sender.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ module Microsoft.ApplicationInsights {
}, this._config.maxBatchInterval());
}
} catch (e) {
_InternalLogging.throwInternalNonUserActionable(LoggingSeverity.CRITICAL, "trackPageView failed: " + JSON.stringify(e));
_InternalLogging.throwInternalNonUserActionable(LoggingSeverity.CRITICAL, "trackPageView failed: " + Util.dump(e));
}
}

Expand Down Expand Up @@ -170,7 +170,7 @@ module Microsoft.ApplicationInsights {
clearTimeout(this._timeoutHandle);
this._timeoutHandle = null;
} catch (e) {
_InternalLogging.throwInternalNonUserActionable(LoggingSeverity.CRITICAL, "trackPageView failed: " + JSON.stringify(e));
_InternalLogging.throwInternalNonUserActionable(LoggingSeverity.CRITICAL, "trackPageView failed: " + Util.dump(e));
}
}

Expand Down
22 changes: 11 additions & 11 deletions JavaScript/JavaScriptSDK/appInsights.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ module Microsoft.ApplicationInsights {

this._pageTracking.start(name);
} catch (e) {
_InternalLogging.throwInternalNonUserActionable(LoggingSeverity.CRITICAL, "startTrackPage failed: " + JSON.stringify(e));
_InternalLogging.throwInternalNonUserActionable(LoggingSeverity.CRITICAL, "startTrackPage failed: " + Util.dump(e));
}
}

Expand All @@ -127,7 +127,7 @@ module Microsoft.ApplicationInsights {

this._pageTracking.stop(name, url, properties, measurements);
} catch (e) {
_InternalLogging.throwInternalNonUserActionable(LoggingSeverity.CRITICAL, "stopTrackPage failed, page view will not be collected: " + JSON.stringify(e));
_InternalLogging.throwInternalNonUserActionable(LoggingSeverity.CRITICAL, "stopTrackPage failed, page view will not be collected: " + Util.dump(e));
}
}

Expand Down Expand Up @@ -177,7 +177,7 @@ module Microsoft.ApplicationInsights {
}
}
} catch (e) {
_InternalLogging.throwInternalNonUserActionable(LoggingSeverity.CRITICAL, "trackPageView failed on page load calculation: " + JSON.stringify(e));
_InternalLogging.throwInternalNonUserActionable(LoggingSeverity.CRITICAL, "trackPageView failed on page load calculation: " + Util.dump(e));
}
}, 100);
}
Expand All @@ -193,7 +193,7 @@ module Microsoft.ApplicationInsights {
this.context._sender.triggerSend();
}, 100);
} catch (e) {
_InternalLogging.throwInternalNonUserActionable(LoggingSeverity.CRITICAL, "trackPageView failed, page view will not be collected: " + JSON.stringify(e));
_InternalLogging.throwInternalNonUserActionable(LoggingSeverity.CRITICAL, "trackPageView failed, page view will not be collected: " + Util.dump(e));
}
}

Expand All @@ -205,7 +205,7 @@ module Microsoft.ApplicationInsights {
try {
this._eventTracking.start(name);
} catch (e) {
_InternalLogging.throwInternalNonUserActionable(LoggingSeverity.CRITICAL, "startTrackEvent failed, event will not be collected: " + JSON.stringify(e));
_InternalLogging.throwInternalNonUserActionable(LoggingSeverity.CRITICAL, "startTrackEvent failed, event will not be collected: " + Util.dump(e));
}
}

Expand All @@ -219,7 +219,7 @@ module Microsoft.ApplicationInsights {
try {
this._eventTracking.stop(name, undefined, properties, measurements);
} catch (e) {
_InternalLogging.throwInternalNonUserActionable(LoggingSeverity.CRITICAL, "stopTrackEvent failed, event will not be collected: " + JSON.stringify(e));
_InternalLogging.throwInternalNonUserActionable(LoggingSeverity.CRITICAL, "stopTrackEvent failed, event will not be collected: " + Util.dump(e));
}
}

Expand All @@ -236,7 +236,7 @@ module Microsoft.ApplicationInsights {
var envelope = new Telemetry.Common.Envelope(data, Telemetry.Event.envelopeType);
this.context.track(envelope);
} catch (e) {
_InternalLogging.throwInternalNonUserActionable(LoggingSeverity.CRITICAL, "trackEvent failed, event will not be collected: " + JSON.stringify(e));
_InternalLogging.throwInternalNonUserActionable(LoggingSeverity.CRITICAL, "trackEvent failed, event will not be collected: " + Util.dump(e));
}
}

Expand All @@ -262,7 +262,7 @@ module Microsoft.ApplicationInsights {
var envelope = new Telemetry.Common.Envelope(data, Telemetry.Exception.envelopeType);
this.context.track(envelope);
} catch (e) {
_InternalLogging.throwInternalNonUserActionable(LoggingSeverity.CRITICAL, "trackException failed, exception will not be collected: " + JSON.stringify(e));
_InternalLogging.throwInternalNonUserActionable(LoggingSeverity.CRITICAL, "trackException failed, exception will not be collected: " + Util.dump(e));
}
}

Expand All @@ -284,7 +284,7 @@ module Microsoft.ApplicationInsights {

this.context.track(envelope);
} catch (e) {
_InternalLogging.throwInternalNonUserActionable(LoggingSeverity.CRITICAL, "trackMetric failed, metric will not be collected: " + JSON.stringify(e));
_InternalLogging.throwInternalNonUserActionable(LoggingSeverity.CRITICAL, "trackMetric failed, metric will not be collected: " + Util.dump(e));
}
}

Expand All @@ -296,7 +296,7 @@ module Microsoft.ApplicationInsights {

this.context.track(envelope);
} catch (e) {
_InternalLogging.warnToConsole("trackTrace failed, trace will not be collected: " + JSON.stringify(e));
_InternalLogging.warnToConsole("trackTrace failed, trace will not be collected: " + Util.dump(e));
}
}

Expand All @@ -307,7 +307,7 @@ module Microsoft.ApplicationInsights {
try {
this.context._sender.triggerSend();
} catch (e) {
_InternalLogging.throwInternalNonUserActionable(LoggingSeverity.CRITICAL, "flush failed, telemetry will not be collected: " + JSON.stringify(e));
_InternalLogging.throwInternalNonUserActionable(LoggingSeverity.CRITICAL, "flush failed, telemetry will not be collected: " + Util.dump(e));
}
}

Expand Down

0 comments on commit 0a8d140

Please sign in to comment.