diff --git a/src/driver/controller-synology/http/index.js b/src/driver/controller-synology/http/index.js index 9298d0c..be9fd40 100644 --- a/src/driver/controller-synology/http/index.js +++ b/src/driver/controller-synology/http/index.js @@ -115,9 +115,6 @@ class SynologyHttpClient { } log_response(error, response, body, options) { - let prop; - let val; - const cleansedBody = JSON.parse(stringify(body)); const cleansedOptions = JSON.parse(stringify(options)); // This function handles arrays and objects @@ -154,8 +151,12 @@ class SynologyHttpClient { this.logger.debug("SYNOLOGY HTTP REQUEST: " + stringify(cleansedOptions)); this.logger.debug("SYNOLOGY HTTP ERROR: " + error); - this.logger.debug("SYNOLOGY HTTP STATUS: " + response.statusCode); - this.logger.debug("SYNOLOGY HTTP HEADERS: " + stringify(response.headers)); + this.logger.debug( + "SYNOLOGY HTTP STATUS: " + _.get(response, "statusCode", "") + ); + this.logger.debug( + "SYNOLOGY HTTP HEADERS: " + stringify(_.get(response, "headers", "")) + ); this.logger.debug("SYNOLOGY HTTP BODY: " + stringify(cleansedBody)); } diff --git a/src/driver/freenas/http/index.js b/src/driver/freenas/http/index.js index 9b0a02b..d800e34 100644 --- a/src/driver/freenas/http/index.js +++ b/src/driver/freenas/http/index.js @@ -127,8 +127,12 @@ class Client { this.logger.debug("FREENAS HTTP REQUEST: " + stringify(options)); this.logger.debug("FREENAS HTTP ERROR: " + error); - this.logger.debug("FREENAS HTTP STATUS: " + response.statusCode); - this.logger.debug("FREENAS HTTP HEADERS: " + stringify(response.headers)); + this.logger.debug( + "FREENAS HTTP STATUS: " + _.get(response, "statusCode", "") + ); + this.logger.debug( + "FREENAS HTTP HEADERS: " + stringify(_.get(response, "headers", "")) + ); this.logger.debug("FREENAS HTTP BODY: " + stringify(body)); }