Non descriptive script error is send to Raygun Dashboard
Raybever
Posted on
Feb 06 2015
I have an AngularJS app Raygun enabled in the following way:
<script type="text/javascript" src="thirdparty/raygun.min.js"></script>
<script>
Raygun.init('my key', {
allowInsecureSubmissions: true,
ignoreAjaxAbort: true
//debugMode: true,
//ignore3rdPartyErrors: true,
//wrapAsynchronousCallbacks: true
//excludedHostnames: ['localhost']
}).attach();
</script>
Angular init:
myApp.factory('$exceptionHandler', function () {
return function (exception) {
Raygun.send(exception);
}
});
Now I am testing (NOTE: On localhost, using IE 11 and also tested it with Chrome) it using the following statement inside a controller:
throw "Test";
Now I was hoping the exception error 'Test' would arrive at my Dashboard but I only get:
Script error
When I look at the console I see a CORS informational message: XMLHttpRequest for https://api.raygun.io/entries?apikey=myKey required Cross Origin Resource Sharing (CORS).
What am I doing wrong?
Callum
Posted on
Feb 06 2015
Try calling throw new Error('test') instead - throwing a string won't cause the library to pick up the stack trace. If you're still seeing the issue after this let us know. Also try setting allowInsecureSubmissions to false as this uses the XHR object to send which is supported in IE11.