mirror of
https://github.com/valitydev/thrift.git
synced 2024-11-07 02:45:22 +00:00
parent
10cfd6a504
commit
63b75d9e3a
@ -170,7 +170,7 @@ var HttpConnection = exports.HttpConnection = function(options) {
|
|||||||
var dataLen = 0;
|
var dataLen = 0;
|
||||||
|
|
||||||
if (response.statusCode !== 200) {
|
if (response.statusCode !== 200) {
|
||||||
this.emit("error", new THTTPException(statusCode, response));
|
this.emit("error", new THTTPException(response));
|
||||||
}
|
}
|
||||||
|
|
||||||
response.on('error', function (e) {
|
response.on('error', function (e) {
|
||||||
@ -251,11 +251,11 @@ exports.createHttpUDSConnection = function(path, options) {
|
|||||||
exports.createHttpClient = createClient
|
exports.createHttpClient = createClient
|
||||||
|
|
||||||
|
|
||||||
function THTTPException(statusCode, response) {
|
function THTTPException(response) {
|
||||||
thrift.TApplicationException.call(this);
|
thrift.TApplicationException.call(this);
|
||||||
Error.captureStackTrace(this, this.constructor);
|
Error.captureStackTrace(this, this.constructor);
|
||||||
this.name = this.constructor.name;
|
this.name = this.constructor.name;
|
||||||
this.statusCode = statusCode;
|
this.statusCode = response.statusCode;
|
||||||
this.response = response;
|
this.response = response;
|
||||||
this.type = thrift.TApplicationExceptionType.PROTOCOL_ERROR;
|
this.type = thrift.TApplicationExceptionType.PROTOCOL_ERROR;
|
||||||
this.message = "Received a response with a bad HTTP status code: " + response.statusCode;
|
this.message = "Received a response with a bad HTTP status code: " + response.statusCode;
|
||||||
|
Loading…
Reference in New Issue
Block a user