diff --git a/FAQ.md b/FAQ.md index 989ed23..c3bfaaa 100644 --- a/FAQ.md +++ b/FAQ.md @@ -18,3 +18,11 @@ You can also use an un-minified version of the JS SDK script [ai.js](https://az4 ## When I debug the SDK a lot of methods of the `appInsights` object are missing ## Most likely you hit a breakpoint before the full SDK was downloaded and you're only seeing methods defined in the snippet. The snippet only defines stubs of all `track*()` and `[set|clear]AuthenticatedUserContext` functions and records if they were invoked. When the full library is downloaded ([ai.0.js](https://az416426.vo.msecnd.net/scripts/a/ai.0.js)) all those stubs are replaced with real methods and all previously recorded methods are actually invoked and processed. + +## I'm seeing a lot of `Uncaught [object Object]` errors in Application Insights in Azure Portal ## +The JS SDK is using a `message` field from the [Error](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error) object as an error message. If you throw something which is not an Error it will call `toString` and use that as an error message. + +``` +throw { a: '1', b: '2' }; // "Uncaught [object Object]" +throw { a: '1', b: '2', toString: () => 'a + b' }; // "Uncaught a + b" +``` \ No newline at end of file