diff --git a/bower.json b/bower.json index 7b1157e..f107080 100644 --- a/bower.json +++ b/bower.json @@ -1,7 +1,7 @@ { "name": "stratajs", "description": "JavaScript Library to interact with the Red Hat Customer Portal API", - "version": "1.6.9", + "version": "1.7.0", "main": "strata.js", "repository": { "type": "git", @@ -20,4 +20,4 @@ "email": "dvarga@redhat.com" } ] -} +} \ No newline at end of file diff --git a/strata.js b/strata.js index 7ceca19..74e7075 100644 --- a/strata.js +++ b/strata.js @@ -95,9 +95,27 @@ addCaseSbrs, removeCaseSbrs; - strata.version = '1.6.8'; + strata.version = '1.7.0'; redhatClientID = 'stratajs-' + strata.version; + strata.logToSentry = function (message) { + if (!message) { + return; + } + if (window.sessionjs && window.sessionjs.reportProblem) { + if (window.app) { + window.sessionjs.reportProblem(message, { + tags: { + portal_app: window.app + } + }); + } else { + window.sessionjs.reportProblem(message); + } + } + + } + function getIsTokenExpired() { if (window.sessionjs && window.sessionjs.isTokenExpired) { return window.sessionjs.isTokenExpired; @@ -133,21 +151,11 @@ } // function for reporting error to sentry - function reportToSentry(method, path, generatedBy) { - if (window.sessionjs && window.sessionjs.reportProblem) { - if (window.app) { - window.sessionjs.reportProblem('received 401 from ' + method + ' ' + path + ' generated by ' + generatedBy, { - tags: { - portal_app: window.app - } - }); - } else { - window.sessionjs.reportProblem('received 401 from ' + method + ' ' + path + ' generated by ' + generatedBy); - } - } - + function report401ToSentry(method, path, generatedBy) { + strata.logToSentry('received 401 from ' + method + ' ' + path + ' generated by ' + generatedBy); } + if (window.portal && window.portal.host) { //if this is a chromed app this will work otherwise we default to prod portalHostname = new Uri(window.portal.host).host(); @@ -448,7 +456,7 @@ }, error: function (xhr, reponse, status) { if (xhr.status == 401) { - reportToSentry('POST', '/rs/problems', 'strata.problems'); + report401ToSentry('POST', '/rs/problems', 'strata.problems'); } onFailure('Error ' + xhr.status + ' ' + xhr.statusText, xhr, reponse, status); } @@ -487,7 +495,7 @@ }, error: function (xhr, reponse, status) { if (xhr.status == 401) { - reportToSentry('POST', '/rs/problems', 'strata.recommendations'); + report401ToSentry('POST', '/rs/problems', 'strata.recommendations'); } onFailure('Error ' + xhr.status + ' ' + xhr.statusText, xhr, reponse, status); } @@ -531,7 +539,7 @@ }, error: function (xhr, response, status) { if (xhr.status == 401) { - reportToSentry('POST', '/rs/recommendations', 'strata.recommendationForCase'); + report401ToSentry('POST', '/rs/recommendations', 'strata.recommendationForCase'); } onFailure('Error ' + xhr.status + ' ' + xhr.statusText, xhr, response, status); } @@ -559,7 +567,7 @@ }, error: function (xhr, reponse, status) { if (xhr.status == 401) { - reportToSentry('GET', '/rs/users', 'strata.users.get'); + report401ToSentry('GET', '/rs/users', 'strata.users.get'); } onFailure('Error ' + xhr.status + ' ' + xhr.statusText, xhr, reponse, status); } @@ -581,7 +589,7 @@ }, error: function (xhr, response, status) { if (xhr.status == 401) { - reportToSentry('GET', '/rs/users', 'strata.users.getBySSo'); + report401ToSentry('GET', '/rs/users', 'strata.users.getBySSo'); } onFailure('Error ' + xhr.status + ' ' + xhr.statusText, xhr, response, status); } @@ -605,7 +613,7 @@ }, error: function (xhr, reponse, status) { if (xhr.status == 401) { - reportToSentry('POST', '/rs/users/', 'strata.users.getBySSo'); + report401ToSentry('POST', '/rs/users/', 'strata.users.getBySSo'); } onFailure('Error ' + xhr.status + ' ' + xhr.statusText, xhr, reponse, status); } @@ -637,7 +645,7 @@ }, error: function (xhr, reponse, status) { if (xhr.status == 401) { - reportToSentry('GET', '/rs/solutions/', 'strata.solutions.get'); + report401ToSentry('GET', '/rs/solutions/', 'strata.solutions.get'); } onFailure('Error ' + xhr.status + ' ' + xhr.statusText, xhr, reponse, status); } @@ -670,7 +678,7 @@ }, error: function (xhr, reponse, status) { if (xhr.status == 401) { - reportToSentry('GET', '/rs/solutions/', 'strata.solutions.search'); + report401ToSentry('GET', '/rs/solutions/', 'strata.solutions.search'); } onFailure('Error ' + xhr.status + ' ' + xhr.statusText, xhr, reponse, status); } @@ -694,7 +702,7 @@ }, error: function (xhr, response, status) { if (xhr.status == 401) { - reportToSentry('POST', '/rs/solutions/', 'strata.solutions.post'); + report401ToSentry('POST', '/rs/solutions/', 'strata.solutions.post'); } onFailure('Error ' + xhr.status + ' ' + xhr.statusText, xhr, response, status); } @@ -730,7 +738,7 @@ }, error: function (xhr, reponse, status) { if (xhr.status == 401) { - reportToSentry('GET', '/rs/articles/', 'strata.articles.get'); + report401ToSentry('GET', '/rs/articles/', 'strata.articles.get'); } onFailure('Error ' + xhr.status + ' ' + xhr.statusText, xhr, reponse, status); } @@ -765,7 +773,7 @@ }, error: function (xhr, reponse, status) { if (xhr.status == 401) { - reportToSentry('GET', '/rs/articles/', 'strata.articles.search'); + report401ToSentry('GET', '/rs/articles/', 'strata.articles.search'); } onFailure('Error ' + xhr.status + ' ' + xhr.statusText, xhr, reponse, status); } @@ -802,7 +810,7 @@ onSuccess(); }, 400: onFailure, - 401: reportToSentry('PUT', '/rs/se/session/', 'strata.solutionEngine.sendCaseNumber') + 401: report401ToSentry('PUT', '/rs/se/session/', 'strata.solutionEngine.sendCaseNumber') } }); }; @@ -836,7 +844,7 @@ }, error: function (xhr, reponse, status) { if (xhr.status == 401) { - reportToSentry('GET', '/rs/cases/', 'strata.cases.get'); + report401ToSentry('GET', '/rs/cases/', 'strata.cases.get'); } onFailure('Error ' + xhr.status + ' ' + xhr.statusText, xhr, reponse, status); } @@ -868,7 +876,7 @@ onSuccess(); }, 400: onFailure, - 401: reportToSentry('PUT', '/rs/cases/', 'strata.cases.comments.update') + 401: report401ToSentry('PUT', '/rs/cases/', 'strata.cases.comments.update') } }); }; @@ -899,7 +907,7 @@ }, error: function (xhr, reponse, status) { if (xhr.status == 401) { - reportToSentry('GET', '/rs/cases/', 'strata.cases.comments.get'); + report401ToSentry('GET', '/rs/cases/', 'strata.cases.comments.get'); } onFailure('Error ' + xhr.status + ' ' + xhr.statusText, xhr, reponse, status); } @@ -932,7 +940,7 @@ }, error: function (xhr, reponse, status) { if (xhr.status == 401) { - reportToSentry('GET', '/rs/cases/externalTrackerUpdates', 'strata.cases.externalUpdates.list'); + report401ToSentry('GET', '/rs/cases/externalTrackerUpdates', 'strata.cases.externalUpdates.list'); } onFailure('Error ' + xhr.status + ' ' + xhr.statusText, xhr, reponse, status); } @@ -978,7 +986,7 @@ }, error: function (xhr, reponse, status) { if (xhr.status == 401) { - reportToSentry('POST', '/rs/cases/comments', 'strata.cases.comment.post'); + report401ToSentry('POST', '/rs/cases/comments', 'strata.cases.comment.post'); } onFailure('Error ' + xhr.status + ' ' + xhr.statusText, xhr, reponse, status); } @@ -1011,7 +1019,7 @@ }, error: function (xhr, reponse, status) { if (xhr.status == 401) { - reportToSentry('GET', '/rs/cases/', 'strata.cases.list'); + report401ToSentry('GET', '/rs/cases/', 'strata.cases.list'); } onFailure('Error ' + xhr.status + ' ' + xhr.statusText, xhr, reponse, status); } @@ -1158,7 +1166,7 @@ }, error: function (xhr, reponse, status) { if (xhr.status == 401) { - reportToSentry('GET', '/rs/cases/', 'strata.cases.search'); + report401ToSentry('GET', '/rs/cases/', 'strata.cases.search'); } onFailure('Error ' + xhr.status + ' ' + xhr.statusText, xhr, reponse, status); } @@ -1183,21 +1191,21 @@ var ajaxParams = { url: url, - success: function (response) { - if (format == 'csv') { - onSuccess(response); - } else { - if (response['case'] != undefined) { - response['case'].forEach(convertDates); + success: function (response) { + if (format == 'csv') { onSuccess(response); } else { - onSuccess([]); + if (response['case'] != undefined) { + response['case'].forEach(convertDates); + onSuccess(response); + } else { + onSuccess([]); + } } - } - }, + }, error: function (xhr, response, status) { if (xhr.status == 401) { - reportToSentry('GET', '/rs/cases/', 'strata.cases.advancedSearch'); + report401ToSentry('GET', '/rs/cases/', 'strata.cases.advancedSearch'); } onFailure('Error ' + xhr.status + ' ' + xhr.statusText, xhr, response, status); } @@ -1244,7 +1252,7 @@ }, error: function (xhr, reponse, status) { if (xhr.status == 401) { - reportToSentry('POST', '/rs/cases/notified_users', 'strata.cases.notified_users.add'); + report401ToSentry('POST', '/rs/cases/notified_users', 'strata.cases.notified_users.add'); } onFailure('Error ' + xhr.status + ' ' + xhr.statusText, xhr, reponse, status); } @@ -1271,7 +1279,7 @@ success: onSuccess, error: function (xhr, reponse, status) { if (xhr.status == 401) { - reportToSentry('DELETE', '/rs/cases/notified_users', 'strata.cases.notified_users'); + report401ToSentry('DELETE', '/rs/cases/notified_users', 'strata.cases.notified_users'); } onFailure('Error ' + xhr.status + ' ' + xhr.statusText, xhr, reponse, status); } @@ -1309,7 +1317,7 @@ }, error: function (xhr, reponse, status) { if (xhr.status == 401) { - reportToSentry('POST', '/rs/cases/sbr', 'strata.cases.sbrs.add'); + report401ToSentry('POST', '/rs/cases/sbr', 'strata.cases.sbrs.add'); } onFailure('Error ' + xhr.status + ' ' + xhr.statusText, xhr, reponse, status); } @@ -1337,7 +1345,7 @@ success: onSuccess, error: function (xhr, reponse, status) { if (xhr.status == 401) { - reportToSentry('DELETE', '/rs/cases/sbr', 'strata.cases.sbrs.remove'); + report401ToSentry('DELETE', '/rs/cases/sbr', 'strata.cases.sbrs.remove'); } onFailure('Error ' + xhr.status + ' ' + xhr.statusText, xhr, reponse, status); } @@ -1360,7 +1368,7 @@ }, error: function (xhr, response, status) { if (xhr.status == 401) { - reportToSentry('GET', '/rs/cases', 'strata.cases.csv'); + report401ToSentry('GET', '/rs/cases', 'strata.cases.csv'); } onFailure('Error ' + xhr.status + ' ' + xhr.statusText, xhr, response, status); } @@ -1395,7 +1403,7 @@ }, error: function (xhr, reponse, status) { if (xhr.status == 401) { - reportToSentry('POST', '/rs/cases/filter', 'strata.cases.filter'); + report401ToSentry('POST', '/rs/cases/filter', 'strata.cases.filter'); } onFailure('Error ' + xhr.status + ' ' + xhr.statusText, xhr, reponse, status); } @@ -1431,7 +1439,7 @@ }, error: function (xhr, reponse, status) { if (xhr.status == 401) { - reportToSentry('POST', '/rs/cases', 'strata.cases.post'); + report401ToSentry('POST', '/rs/cases', 'strata.cases.post'); } onFailure('Error ' + xhr.status + ' ' + xhr.statusText, xhr, reponse, status); } @@ -1475,7 +1483,7 @@ }, error: function (xhr, reponse, status) { if (xhr.status == 401) { - reportToSentry('PUT', '/rs/cases', 'strata.cases.put'); + report401ToSentry('PUT', '/rs/cases', 'strata.cases.put'); } onFailure('Error ' + xhr.status + ' ' + xhr.statusText, xhr, reponse, status); } @@ -1509,7 +1517,7 @@ }, error: function (xhr, reponse, status) { if (xhr.status == 401) { - reportToSentry('GET', '/rs/cases/attachments', 'strata.cases.attachments.list'); + report401ToSentry('GET', '/rs/cases/attachments', 'strata.cases.attachments.list'); } onFailure('Error ' + xhr.status + ' ' + xhr.statusText, xhr, reponse, status); } @@ -1563,7 +1571,7 @@ success: onSuccess, error: function (xhr, response, status) { if (xhr.status == 401) { - reportToSentry('POST', '/rs/cases/attachments', 'strata.cases.attachment.post'); + report401ToSentry('POST', '/rs/cases/attachments', 'strata.cases.attachment.post'); } // When xhr.getAllResponseHeaders() doesn't exist the xhr request has been manually aborted. @@ -1593,7 +1601,7 @@ success: onSuccess, error: function (xhr, reponse, status) { if (xhr.status == 401) { - reportToSentry('DELETE', '/rs/cases/attachments', 'strata.cases.attachments.remove'); + report401ToSentry('DELETE', '/rs/cases/attachments', 'strata.cases.attachments.remove'); } onFailure('Error ' + xhr.status + ' ' + xhr.statusText, xhr, reponse, status); } @@ -1617,7 +1625,7 @@ success: onSuccess, error: function (xhr, reponse, status) { if (xhr.status == 401) { - reportToSentry('POST', '/rs/internal/cases/changeowner', 'strata.cases.owner.update'); + report401ToSentry('POST', '/rs/internal/cases/changeowner', 'strata.cases.owner.update'); } onFailure('Error ' + xhr.status + ' ' + xhr.statusText, xhr, reponse, status); } @@ -1650,7 +1658,7 @@ }, error: function (xhr, reponse, status) { if (xhr.status == 401) { - reportToSentry('POST', '/rs/symptoms/extractractor', 'strata.symptons.extractor'); + report401ToSentry('POST', '/rs/symptoms/extractractor', 'strata.symptons.extractor'); } onFailure('Error ' + xhr.status + ' ' + xhr.statusText, xhr, reponse, status); } @@ -1683,7 +1691,7 @@ }, error: function (xhr, reponse, status) { if (xhr.status == 401) { - reportToSentry('GET', '/rs/groups', 'strata.groups.list'); + report401ToSentry('GET', '/rs/groups', 'strata.groups.list'); } onFailure('Error ' + xhr.status + ' ' + xhr.statusText, xhr, reponse, status); } @@ -1723,7 +1731,7 @@ 400: throwError, 409: throwError, 500: throwError, - 401: reportToSentry('POST', '/rs/groups', 'strata.groups.create') + 401: report401ToSentry('POST', '/rs/groups', 'strata.groups.create') } }); }; @@ -1760,7 +1768,7 @@ }, 400: throwError, 500: throwError, - 401: reportToSentry('PUT', '/rs/groups', 'strata.groups.update') + 401: report401ToSentry('PUT', '/rs/groups', 'strata.groups.update') } }); }; @@ -1790,7 +1798,7 @@ }, 400: throwError, 500: throwError, - 401: reportToSentry('POST', '/rs/groups/default', 'strata.groups.createDefault') + 401: report401ToSentry('POST', '/rs/groups/default', 'strata.groups.createDefault') } }); }; @@ -1820,7 +1828,7 @@ 400: throwError, 500: throwError, 502: throwError, - 401: reportToSentry('DELETE', '/rs/groups', 'strata.groups.remove') + 401: report401ToSentry('DELETE', '/rs/groups', 'strata.groups.remove') } }); }; @@ -1844,7 +1852,7 @@ success: onSuccess, error: function (xhr, reponse, status) { if (xhr.status == 401) { - reportToSentry('GET', '/rs/groups', 'strata.groups.get'); + report401ToSentry('GET', '/rs/groups', 'strata.groups.get'); } onFailure('Error ' + xhr.status + ' ' + xhr.statusText, xhr, reponse, status); } @@ -1879,7 +1887,7 @@ 400: throwError, 500: throwError, 502: throwError, - 401: reportToSentry('PUT', '/rs/account/groups/users', 'strata.groupUsers.update') + 401: report401ToSentry('PUT', '/rs/account/groups/users', 'strata.groupUsers.update') } }); }; @@ -1908,7 +1916,7 @@ }, error: function (xhr, reponse, status) { if (xhr.status == 401) { - reportToSentry('GET', '/rs/products/contact', 'strata.products.list'); + report401ToSentry('GET', '/rs/products/contact', 'strata.products.list'); } onFailure('Error ' + xhr.status + ' ' + xhr.statusText, xhr, reponse, status); } @@ -1934,7 +1942,7 @@ success: onSuccess, error: function (xhr, reponse, status) { if (xhr.status == 401) { - reportToSentry('GET', '/rs/products', 'strata.products.get'); + report401ToSentry('GET', '/rs/products', 'strata.products.get'); } onFailure('Error ' + xhr.status + ' ' + xhr.statusText, xhr, reponse, status); } @@ -1966,7 +1974,7 @@ }, error: function (xhr, reponse, status) { if (xhr.status == 401) { - reportToSentry('GET', '/rs/products/versions', 'strata.products.version'); + report401ToSentry('GET', '/rs/products/versions', 'strata.products.version'); } onFailure('Error ' + xhr.status + ' ' + xhr.statusText, xhr, reponse, status); } @@ -1996,7 +2004,7 @@ }, error: function (xhr, reponse, status) { if (xhr.status == 401) { - reportToSentry('GET', '/rs/values/cases/types', 'strata.values.cases.types'); + report401ToSentry('GET', '/rs/values/cases/types', 'strata.values.cases.types'); } onFailure('Error ' + xhr.status + ' ' + xhr.statusText, xhr, reponse, status); } @@ -2021,7 +2029,7 @@ }, error: function (xhr, reponse, status) { if (xhr.status == 401) { - reportToSentry('GET', '/rs/values/cases/severity', 'strata.values.cases.severity'); + report401ToSentry('GET', '/rs/values/cases/severity', 'strata.values.cases.severity'); } onFailure('Error ' + xhr.status + ' ' + xhr.statusText, xhr, reponse, status); } @@ -2046,7 +2054,7 @@ }, error: function (xhr, reponse, status) { if (xhr.status == 401) { - reportToSentry('GET', '/rs/values/cases/status', 'strata.values.cases.status'); + report401ToSentry('GET', '/rs/values/cases/status', 'strata.values.cases.status'); } onFailure('Error ' + xhr.status + ' ' + xhr.statusText, xhr, reponse, status); } @@ -2071,7 +2079,7 @@ }, error: function (xhr, reponse, status) { if (xhr.status == 401) { - reportToSentry('GET', '/rs/values/cases/attachment/size', 'strata.values.attachment.size'); + report401ToSentry('GET', '/rs/values/cases/attachment/size', 'strata.values.attachment.size'); } onFailure('Error ' + xhr.status + ' ' + xhr.statusText, xhr, reponse, status); } @@ -2100,7 +2108,7 @@ }, error: function (xhr, reponse, status) { if (xhr.status == 401) { - reportToSentry('GET', '/rs/values/businesshours', 'strata.values.businesshours'); + report401ToSentry('GET', '/rs/values/businesshours', 'strata.values.businesshours'); } onFailure('Error ' + xhr.status + ' ' + xhr.statusText, xhr, reponse, status); } @@ -2128,7 +2136,7 @@ }, error: function (xhr, reponse, status) { if (xhr.status == 401) { - reportToSentry('GET', '/rs/system_profiles', 'strata.systemProfiles'); + report401ToSentry('GET', '/rs/system_profiles', 'strata.systemProfiles'); } onFailure('Error ' + xhr.status + ' ' + xhr.statusText, xhr, reponse, status); } @@ -2161,7 +2169,7 @@ }, error: function (xhr, reponse, status) { if (xhr.status == 401) { - reportToSentry('GET', '/rs/system_profiles', 'strata.systemProfiles.get'); + report401ToSentry('GET', '/rs/system_profiles', 'strata.systemProfiles.get'); } onFailure('Error ' + xhr.status + ' ' + xhr.statusText, xhr, reponse, status); } @@ -2192,7 +2200,7 @@ }, error: function (xhr, reponse, status) { if (xhr.status == 401) { - reportToSentry('POST', '/rs/system_profiles', 'strata.systemProfiles.post'); + report401ToSentry('POST', '/rs/system_profiles', 'strata.systemProfiles.post'); } onFailure('Error ' + xhr.status + ' ' + xhr.statusText, xhr, reponse, status); } @@ -2214,7 +2222,7 @@ success: onSuccess, error: function (xhr, reponse, status) { if (xhr.status == 401) { - reportToSentry('GET', '/rs/accounts', 'strata.accounts.list'); + report401ToSentry('GET', '/rs/accounts', 'strata.accounts.list'); } onFailure('Error ' + xhr.status + ' ' + xhr.statusText, xhr, reponse, status); } @@ -2240,7 +2248,7 @@ success: onSuccess, error: function (xhr, reponse, status) { if (xhr.status == 401) { - reportToSentry('GET', '/rs/accounts', 'strata.accounts.get'); + report401ToSentry('GET', '/rs/accounts', 'strata.accounts.get'); } onFailure('Error ' + xhr.status + ' ' + xhr.statusText, xhr, reponse, status); } @@ -2275,7 +2283,7 @@ }, error: function (xhr, reponse, status) { if (xhr.status == 401) { - reportToSentry('GET', '/rs/accounts/users', 'strata.accounts.users'); + report401ToSentry('GET', '/rs/accounts/users', 'strata.accounts.users'); } onFailure('Error ' + xhr.status + ' ' + xhr.statusText, xhr, reponse, status); } @@ -2302,7 +2310,7 @@ success: onSuccess, error: function (xhr, response, status) { if (xhr.status == 401) { - reportToSentry('POST', '/rs/accounts/bookmarks', 'strata.accounts.addBookmark'); + report401ToSentry('POST', '/rs/accounts/bookmarks', 'strata.accounts.addBookmark'); } onFailure('Error ' + xhr.status + ' ' + xhr.statusText, xhr, response, status); } @@ -2326,7 +2334,7 @@ success: onSuccess, error: function (xhr, response, status) { if (xhr.status == 401) { - reportToSentry('DELETE', '/rs/accounts/bookmarks', 'strata.accounts.removeBookmark'); + report401ToSentry('DELETE', '/rs/accounts/bookmarks', 'strata.accounts.removeBookmark'); } onFailure('Error ' + xhr.status + ' ' + xhr.statusText, xhr, response, status); } @@ -2352,7 +2360,7 @@ success: onSuccess, error: function (xhr, reponse, status) { if (xhr.status == 401) { - reportToSentry('GET', '/rs/accounts/customers', 'strata.accounts.getManagedAccounts'); + report401ToSentry('GET', '/rs/accounts/customers', 'strata.accounts.getManagedAccounts'); } onFailure('Error ' + xhr.status + ' ' + xhr.statusText, xhr, reponse, status); } @@ -2378,7 +2386,7 @@ success: onSuccess, error: function (xhr, reponse, status) { if (xhr.status == 401) { - reportToSentry('GET', '/rs/accounts/partner', 'strata.accounts.getManagersForAccount'); + report401ToSentry('GET', '/rs/accounts/partner', 'strata.accounts.getManagersForAccount'); } onFailure('Error ' + xhr.status + ' ' + xhr.statusText, xhr, reponse, status); } @@ -2402,7 +2410,7 @@ success: onSuccess, error: function (xhr, reponse, status) { if (xhr.status == 401) { - reportToSentry('GET', '/rs/entitlements', 'strata.entitlements.get'); + report401ToSentry('GET', '/rs/entitlements', 'strata.entitlements.get'); } onFailure('Error ' + xhr.status + ' ' + xhr.statusText, xhr, reponse, status); } @@ -2455,7 +2463,7 @@ }, error: function (xhr, reponse, status) { if (xhr.status == 401) { - reportToSentry('GET', '/rs/search', 'strata.search'); + report401ToSentry('GET', '/rs/search', 'strata.search'); } onFailure('Error ' + xhr.status + ' ' + xhr.statusText, xhr, reponse, status); } @@ -2478,7 +2486,7 @@ }, error: function (xhr, reponse, status) { if (xhr.status == 401) { - reportToSentry('GET', '/rs/health/sfdc', 'strata.health'); + report401ToSentry('GET', '/rs/health/sfdc', 'strata.health'); } onFailure('Error ' + xhr.status + ' ' + xhr.statusText, xhr, reponse, status); } @@ -2510,7 +2518,7 @@ }, error: function (xhr, reponse, status) { if (xhr.status == 401) { - reportToSentry('GET', '', 'strata.utils.getSelectedText'); + report401ToSentry('GET', '', 'strata.utils.getSelectedText'); } onFailure('Error ' + xhr.status + ' ' + xhr.statusText, xhr, reponse, status); } @@ -2552,7 +2560,7 @@ success: onSuccess, error: function (xhr, reponse, status) { if (xhr.status == 401) { - reportToSentry('GET', '/rs/chats', 'strata.chat.list'); + report401ToSentry('GET', '/rs/chats', 'strata.chat.list'); } onFailure('Error ' + xhr.status + ' ' + xhr.statusText, xhr, reponse, status); } @@ -2593,7 +2601,7 @@ }, error: function (xhr, reponse, status) { if (xhr.status == 401) { - reportToSentry('POST', '/rs/escalations', 'strata.escalation.create'); + report401ToSentry('POST', '/rs/escalations', 'strata.escalation.create'); } onFailure('Error ' + xhr.status + ' ' + xhr.statusText, xhr, reponse, status); } @@ -2621,7 +2629,7 @@ }, error: function (xhr, reponse, status) { if (xhr.status == 401) { - reportToSentry('GET', '/rs/case', 'strata.reviews.getCaseNumber'); + report401ToSentry('GET', '/rs/case', 'strata.reviews.getCaseNumber'); } onFailure('Error ' + xhr.status + ' ' + xhr.statusText, xhr, reponse, status); } @@ -2647,7 +2655,7 @@ }, error: function (xhr, reponse, status) { if (xhr.status == 401) { - reportToSentry('GET', '/rs/recommendations', 'strata.reviews.getSolutionNumber'); + report401ToSentry('GET', '/rs/recommendations', 'strata.reviews.getSolutionNumber'); } onFailure('Error ' + xhr.status + ' ' + xhr.statusText, xhr, reponse, status); } @@ -2680,7 +2688,7 @@ }, error: function (xhr, reponse, status) { if (xhr.status == 401) { - reportToSentry('GET', '/rs/case/symptoms', 'strata.cases.symptoms.get'); + report401ToSentry('GET', '/rs/case/symptoms', 'strata.cases.symptoms.get'); } onFailure('Error ' + xhr.status + ' ' + xhr.statusText, xhr, reponse, status); } @@ -2710,7 +2718,7 @@ }, error: function (xhr, reponse, status) { if (xhr.status == 401) { - reportToSentry('GET', '/rs/problems', 'strata.cases.symptoms.solution.post'); + report401ToSentry('GET', '/rs/problems', 'strata.cases.symptoms.solution.post'); } onFailure('Error ' + xhr.status + ' ' + xhr.statusText, xhr, reponse, status); }