1
0
Fork 0
mirror of https://github.com/terribleplan/next.js.git synced 2024-01-19 02:48:18 +00:00

hot-reloader: return when rejected (#689)

This commit is contained in:
Naoyuki Kanezawa 2017-01-08 11:02:29 +09:00 committed by Guillermo Rauch
parent c6842629ba
commit 0c82d8a483

View file

@ -26,7 +26,7 @@ export default class HotReloader {
for (const fn of this.middlewares) { for (const fn of this.middlewares) {
await new Promise((resolve, reject) => { await new Promise((resolve, reject) => {
fn(req, res, (err) => { fn(req, res, (err) => {
if (err) reject(err) if (err) return reject(err)
resolve() resolve()
}) })
}) })
@ -47,7 +47,7 @@ export default class HotReloader {
if (this.webpackDevMiddleware) { if (this.webpackDevMiddleware) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
this.webpackDevMiddleware.close((err) => { this.webpackDevMiddleware.close((err) => {
if (err) reject(err) if (err) return reject(err)
resolve() resolve()
}) })
}) })