Changeset

11048:160308b4b384

net.http: use new net.http.errors lib for creating error object
author Matthew Wild <mwild1@gmail.com>
date Tue, 25 Aug 2020 15:57:39 +0100
parents 11047:93cdd1ece689
children 11049:f103f59ea2b5
files net/http.lua
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/net/http.lua	Mon Aug 24 19:48:47 2020 +0200
+++ b/net/http.lua	Tue Aug 25 15:57:39 2020 +0100
@@ -13,7 +13,7 @@
 local events = require "util.events";
 local verify_identity = require"util.x509".verify_identity;
 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 connect = require "net.connect".connect;
@@ -291,7 +291,7 @@
 				return promise.new(function (resolve, reject)
 					request(self, u, ex, function (body, code, a, b)
 						if code == 0 then
-							reject(errors.new(body, { request = a }));
+							reject(http_errors.new(body, { request = a }));
 						else
 							resolve({ request = b, response = a });
 						end