mirror of
https://github.com/bjc/prosody.git
synced 2025-04-04 13:47:41 +03:00
net.http: use new net.http.errors lib for creating error object
This commit is contained in:
parent
f25f4bb11a
commit
209660f212
1 changed files with 2 additions and 2 deletions
|
@ -13,7 +13,7 @@ local util_http = require "util.http";
|
||||||
local events = require "util.events";
|
local events = require "util.events";
|
||||||
local verify_identity = require"util.x509".verify_identity;
|
local verify_identity = require"util.x509".verify_identity;
|
||||||
local promise = require "util.promise";
|
local promise = require "util.promise";
|
||||||
local errors = require "util.error";
|
local http_errors = require "net.http.errors";
|
||||||
|
|
||||||
local basic_resolver = require "net.resolvers.basic";
|
local basic_resolver = require "net.resolvers.basic";
|
||||||
local connect = require "net.connect".connect;
|
local connect = require "net.connect".connect;
|
||||||
|
@ -291,7 +291,7 @@ local function new(options)
|
||||||
return promise.new(function (resolve, reject)
|
return promise.new(function (resolve, reject)
|
||||||
request(self, u, ex, function (body, code, a, b)
|
request(self, u, ex, function (body, code, a, b)
|
||||||
if code == 0 then
|
if code == 0 then
|
||||||
reject(errors.new(body, { request = a }));
|
reject(http_errors.new(body, { request = a }));
|
||||||
else
|
else
|
||||||
resolve({ request = b, response = a });
|
resolve({ request = b, response = a });
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue