Skip to content

Commit 0b69655

Browse files
committed
Handle proxy errors
1 parent e50fc44 commit 0b69655

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

lib/http-server.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,13 @@ function HttpServer(options) {
111111
proxy.web(req, res, {
112112
target: options.proxy,
113113
changeOrigin: true
114+
}, function (err, req, res, target) {
115+
if (options.logFn) {
116+
options.logFn(req, res, {
117+
message: err.message,
118+
status: res.statusCode });
119+
}
120+
res.emit('next');
114121
});
115122
});
116123
}

0 commit comments

Comments
 (0)