Skip to content

Commit

Permalink
Handle proxy errors
Browse files Browse the repository at this point in the history
  • Loading branch information
nLight committed Jan 23, 2019
1 parent e50fc44 commit 5d5de72
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/http-server.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,13 @@ function HttpServer(options) {
proxy.web(req, res, {
target: options.proxy,
changeOrigin: true
}, function(err, req, res, target) {
if (options.logFn) {
options.logFn(req, res, {
message: err.message,
status: res.statusCode });
}
res.emit("next");
});
});
}
Expand Down

0 comments on commit 5d5de72

Please sign in to comment.