Skip to content

Commit

Permalink
Merge pull request #52 from MindscapeHQ/pr/51
Browse files Browse the repository at this point in the history
Pr/51
  • Loading branch information
fundead committed May 21, 2014
2 parents f6e56f4 + 65e841d commit 4f2add8
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 10 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ Limited support is available for IE 8 and 9 - errors will only be saved if the r
## Release History
- 1.8.4 - Guard against circular reference in custom data
- 1.8.3 - Allow withCustomData to accept a function to provide a customdata object; fix undefined URL issue from Ajax; rm duplicated Tracekit ajax hook
- 1.8.2 - Fixed bug in Tracekit which caused 'Cannot call method indexOf' of undefined error
- 1.8.1 - Added meaningful message for Ajax errors, fixed debugmode logging bug
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "raygun4js",
"version": "1.8.3",
"version": "1.8.4",
"homepage": "http://raygun.io",
"authors": [
"Mindscape <[email protected]>"
Expand Down
15 changes: 12 additions & 3 deletions dist/raygun.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! Raygun4js - v1.8.3 - 2014-05-08
/*! Raygun4js - v1.8.4 - 2014-05-22
* https://github.com/MindscapeHQ/raygun4js
* Copyright (c) 2014 MindscapeHQ; Licensed MIT */
;(function(window, undefined) {
Expand Down Expand Up @@ -1457,6 +1457,15 @@ window.TraceKit = TraceKit;

var screen = window.screen || { width: getViewPort().width, height: getViewPort().height, colorDepth: 8 };
var custom_message = options.customData && options.customData.ajaxErrorMessage;
var finalCustomData = options.customData;

try {
JSON.stringify(finalCustomData);
} catch (e) {
var msg = 'Cannot add custom data; may contain circular reference';
finalCustomData = { error: msg };
log('Raygun4JS: ' + msg);
}

var payload = {
'OccurredOn': new Date(),
Expand All @@ -1482,9 +1491,9 @@ window.TraceKit = TraceKit;
},
'Client': {
'Name': 'raygun-js',
'Version': '1.8.3'
'Version': '1.8.4'
},
'UserCustomData': options.customData,
'UserCustomData': finalCustomData,
'Tags': options.tags,
'Request': {
'Url': document.location.href,
Expand Down
4 changes: 2 additions & 2 deletions dist/raygun.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "raygun",
"title": "Raygun4js",
"description": "Raygun.io plugin for JavaScript",
"version": "1.8.3",
"version": "1.8.4",
"homepage": "https://github.com/MindscapeHQ/raygun4js",
"author": {
"name": "MindscapeHQ",
Expand Down
2 changes: 1 addition & 1 deletion raygun4js.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>raygun4js</id>
<version>1.8.3</version>
<version>1.8.4</version>
<title>Raygun4js</title>
<authors>Mindscape Limited</authors>
<owners>Mindscape Limited</owners>
Expand Down
13 changes: 11 additions & 2 deletions src/raygun.js
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,15 @@

var screen = window.screen || { width: getViewPort().width, height: getViewPort().height, colorDepth: 8 };
var custom_message = options.customData && options.customData.ajaxErrorMessage;
var finalCustomData = options.customData;

try {
JSON.stringify(finalCustomData);
} catch (e) {
var msg = 'Cannot add custom data; may contain circular reference';
finalCustomData = { error: msg };
log('Raygun4JS: ' + msg);
}

var payload = {
'OccurredOn': new Date(),
Expand All @@ -305,9 +314,9 @@
},
'Client': {
'Name': 'raygun-js',
'Version': '1.8.3'
'Version': '1.8.4'
},
'UserCustomData': options.customData,
'UserCustomData': finalCustomData,
'Tags': options.tags,
'Request': {
'Url': document.location.href,
Expand Down

0 comments on commit 4f2add8

Please sign in to comment.