diff options
author | Filip Spiridonov <filip.spiridonov@gmail.com> | 2018-04-06 05:56:54 -0700 |
---|---|---|
committer | James E. King, III <jking@apache.org> | 2018-04-06 08:56:54 -0400 |
commit | 63b75d9e3a4112b5b278933b487095f7bb431c1c (patch) | |
tree | d77fbffae98279d853d2321271e537a6cb4045b4 /lib/nodejs | |
parent | 10cfd6a504bec4a9aaca04ed9944d49ecf4ce322 (diff) | |
download | thrift-63b75d9e3a4112b5b278933b487095f7bb431c1c.tar.gz |
THRIFT-3926: Fix undeclared statusCode variable (#1531)
Client: nodejs
Diffstat (limited to 'lib/nodejs')
-rw-r--r-- | lib/nodejs/lib/thrift/http_connection.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/nodejs/lib/thrift/http_connection.js b/lib/nodejs/lib/thrift/http_connection.js index 4f5378f43..3c2ab0f53 100644 --- a/lib/nodejs/lib/thrift/http_connection.js +++ b/lib/nodejs/lib/thrift/http_connection.js @@ -170,7 +170,7 @@ var HttpConnection = exports.HttpConnection = function(options) { var dataLen = 0; if (response.statusCode !== 200) { - this.emit("error", new THTTPException(statusCode, response)); + this.emit("error", new THTTPException(response)); } response.on('error', function (e) { @@ -251,11 +251,11 @@ exports.createHttpUDSConnection = function(path, options) { exports.createHttpClient = createClient -function THTTPException(statusCode, response) { +function THTTPException(response) { thrift.TApplicationException.call(this); Error.captureStackTrace(this, this.constructor); this.name = this.constructor.name; - this.statusCode = statusCode; + this.statusCode = response.statusCode; this.response = response; this.type = thrift.TApplicationExceptionType.PROTOCOL_ERROR; this.message = "Received a response with a bad HTTP status code: " + response.statusCode; |