From aba13aa28b1f002878f167754562c83cc989e06c Mon Sep 17 00:00:00 2001 From: Karthikeyan Date: Tue, 3 Jan 2017 15:27:20 +0530 Subject: [PATCH] Handling non formatted Error on traceException Currently if we have any non formatted error message such as without having exception.name , exception.message , exception.stack. We are not tracking the error message instead we end up throwing exception for the track message. So, changed the code in a way that if any unhandled error message ( un-formatted ) we are handling in a app inshights code block. --- src/ApplicationInsights.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/ApplicationInsights.ts b/src/ApplicationInsights.ts index 7f08efd..7a4ab61 100644 --- a/src/ApplicationInsights.ts +++ b/src/ApplicationInsights.ts @@ -316,9 +316,9 @@ class ApplicationInsights { handledAt: "Unhandled", exceptions: [ { - typeName: exception.name, - message: exception.message, - stack: exception.stack, + typeName: exception.name || "Unhandled", + message: exception.message || "Unhandled", + stack: exception.stack || "Unhandled", parsedStack: parsedStack, hasFullStack: !Tools.isNullOrUndefined(parsedStack) } @@ -370,4 +370,4 @@ class ApplicationInsights { this._commonProperties = this._commonProperties || {}; Tools.extend(this._commonProperties, data); } -} \ No newline at end of file +}