diff --git a/packages/error-reporting/src/google-apis/auth-client.js b/packages/error-reporting/src/google-apis/auth-client.js index 1459e929261..c5c99596e17 100644 --- a/packages/error-reporting/src/google-apis/auth-client.js +++ b/packages/error-reporting/src/google-apis/auth-client.js @@ -18,7 +18,6 @@ 'use strict'; const common = require('@google-cloud/common'); const pkg = require('../../package.json'); -var logger = require('../logger.js'); var is = require('is'); var isFunction = is.fn; var isString = is.string; @@ -120,7 +119,7 @@ class RequestHandler extends common.Service { method: 'POST', json: {} }, (err, body, response) => { - if (err && err.message !== 'Message cannot be empty.' && + if (err && err.message !== 'Message cannot be empty.' && response.statusCode === 400) { this._logger.error([ 'Encountered an error while attempting to validate the provided', diff --git a/packages/error-reporting/utils/fuzzer.js b/packages/error-reporting/utils/fuzzer.js index 956a688aae3..c9fa25d92bb 100644 --- a/packages/error-reporting/utils/fuzzer.js +++ b/packages/error-reporting/utils/fuzzer.js @@ -23,10 +23,8 @@ var maxBy = require('lodash.maxby'); var random = require('lodash.random'); var is = require('is'); var isNumber = is.number; -var isObject = is.object; var isString = is.string; var isArray = is.array; -var isNull = is.null; var isFunction = is.function; function Fuzzer() { } @@ -202,7 +200,6 @@ Fuzzer.prototype.generate.object = function(numProperties, currentDepth, allowed Fuzzer.prototype._backFillUnevenTypesArrays = function(argsTypesArray) { - var largestIndex = 0; var largestLength = (maxBy( argsTypesArray , function(o) { return o.length } @@ -292,7 +289,6 @@ Fuzzer.prototype._generateValuesForFuzzTyping = function(typesToFuzzOnEach, inde Fuzzer.prototype.fuzzFunctionForTypes = function(fnToFuzz, expectsArgTypes, cb, withContext) { var expectsArgTypesChecked = isArray(expectsArgTypes) ? expectsArgTypes : []; var typesToFuzzOnEach = this._generateTypesToFuzzWith(expectsArgTypesChecked); - var withContextChecked = (withContext !== undefined) ? withContext : null; var returnValue = undefined;