From 9342262f5c27c570c2d0c71044575f5d563263b4 Mon Sep 17 00:00:00 2001 From: Brett Sun Date: Mon, 14 Dec 2015 14:31:53 +0100 Subject: [PATCH] Move ignoreSentry parameter of logGlobal to be last in parameter list --- js/components/ascribe_forms/form.js | 2 +- js/components/ascribe_uploader/react_s3_fine_uploader.js | 4 ++-- js/utils/error_utils.js | 6 ++---- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/js/components/ascribe_forms/form.js b/js/components/ascribe_forms/form.js index a2b7b9bc..d4002e85 100644 --- a/js/components/ascribe_forms/form.js +++ b/js/components/ascribe_forms/form.js @@ -182,7 +182,7 @@ let Form = React.createClass({ delete formData.password; } - console.logGlobal(err, false, formData); + console.logGlobal(err, formData); if(this.props.isInline) { let notification = new GlobalNotificationModel(getLangText('Something went wrong, please try again later'), 'danger'); diff --git a/js/components/ascribe_uploader/react_s3_fine_uploader.js b/js/components/ascribe_uploader/react_s3_fine_uploader.js index 538b02b7..eb211504 100644 --- a/js/components/ascribe_uploader/react_s3_fine_uploader.js +++ b/js/components/ascribe_uploader/react_s3_fine_uploader.js @@ -440,7 +440,7 @@ const ReactS3FineUploader = React.createClass({ onComplete(id, name, res, xhr) { // There has been an issue with the server's connection if (xhr && xhr.status === 0 && res.success) { - console.logGlobal(new Error('Upload succeeded with a status code 0'), false, { + console.logGlobal(new Error('Upload succeeded with a status code 0'), { files: this.state.filesToUpload, chunks: this.state.chunks, xhr: this.getXhrErrorComment(xhr) @@ -498,7 +498,7 @@ const ReactS3FineUploader = React.createClass({ }, onError(id, name, errorReason, xhr) { - console.logGlobal(errorReason, false, { + console.logGlobal(errorReason, { files: this.state.filesToUpload, chunks: this.state.chunks, xhr: this.getXhrErrorComment(xhr) diff --git a/js/utils/error_utils.js b/js/utils/error_utils.js index 753bbf61..44ebedbe 100644 --- a/js/utils/error_utils.js +++ b/js/utils/error_utils.js @@ -13,8 +13,7 @@ import AppConstants from '../constants/application_constants'; * @param {boolean} ignoreSentry Defines whether or not the error should be submitted to Sentry * @param {string} comment Will also be submitted to Sentry, but will not be logged */ -function logGlobal(error, ignoreSentry = AppConstants.errorMessagesToIgnore.indexOf(error.message) > -1, - comment) { +function logGlobal(error, comment, ignoreSentry = AppConstants.errorMessagesToIgnore.indexOf(error.message) > -1) { console.error(error); if(!ignoreSentry) { @@ -24,7 +23,6 @@ function logGlobal(error, ignoreSentry = AppConstants.errorMessagesToIgnore.inde Raven.captureException(error); } } - } export function initLogging() { @@ -36,4 +34,4 @@ export function initLogging() { window.onerror = Raven.process; console.logGlobal = logGlobal; -} \ No newline at end of file +}