diff --git a/index.js b/index.js index bd093d0..05cbd9a 100644 --- a/index.js +++ b/index.js @@ -6,7 +6,6 @@ var dev = process.env.NODE_ENV == "development"; var handle = function () { throw nextError; } -var appPreparationError = null; var isPrepared = false; var configJSON = {}; @@ -49,7 +48,7 @@ try { handle = initResponse[0]; isPrepared = true; } catch (err) { - appPreparationError = err; + nextError = err; } } init(); @@ -77,7 +76,7 @@ try { app.prepare().then(function () { isPrepared = true; }).catch(function (err) { - appPreparationError = err; + nextError = err; }); } catch (err) { nextError = err; @@ -89,7 +88,7 @@ function Mod() {} Mod.prototype.callback = function callback(req, res, serverconsole, responseEnd, href, ext, uobject, search, defaultpage, users, page404, head, foot, fd, elseCallback, configJSON, callServerError, getCustomHeaders, origHref, redirect, parsePostData) { return async function () { try { - if (appPreparationError) throw appPreparationError; + if (nextError) throw nextError; if (!isPrepared) { callServerError(503, "nextjs-integration/1.0.0"); serverconsole.errmessage("Next.js application not yet fully loaded.");