summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvgeny Zinoviev <me@ch1p.io>2022-03-14 03:04:21 +0300
committerEvgeny Zinoviev <me@ch1p.io>2022-03-14 03:04:21 +0300
commita20b9c9b075414ea76f32d99e7a99a004f394a31 (patch)
treec3a24db2c4016070134a662c9b7fcd39fd8213fb
parentb33e6f0abab13b986e167997ed862f78399ee18a (diff)
maybe another fix
-rw-r--r--index.js7
1 files changed, 3 insertions, 4 deletions
diff --git a/index.js b/index.js
index 8a36078..2d6d9bd 100644
--- a/index.js
+++ b/index.js
@@ -46,7 +46,7 @@ router.get('/request', async (ctx, next) => {
});
}*/
- let myError = false
+ let responseSet = false
await new Promise(async (resolve, reject) => {
const page = await browser.getPage(
(e) => e.isDownload === true,
@@ -87,14 +87,13 @@ router.get('/request', async (ctx, next) => {
ctx.status = 500
ctx.body = error
+ responseSet = true
resolve()
- } else {
- myError = true
}
}
})
- if (!myError)
+ if (!responseSet)
ctx.body = JSON.stringify(myResult)
await next()