mirror of
https://github.com/geekgeekrun/geekgeekrun.git
synced 2026-09-07 08:27:13 +08:00
fix some error cannot be caught due to error throw by async promise executor cannot cause promise transition to rejected status
This commit is contained in:
@@ -175,6 +175,7 @@ export async function mainLoop (hooks) {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
const { targetJobElProxy, targetJobIndex } = await new Promise(async (resolve, reject) => {
|
const { targetJobElProxy, targetJobIndex } = await new Promise(async (resolve, reject) => {
|
||||||
|
try {
|
||||||
// job list
|
// job list
|
||||||
const recommendJobListElProxy = await page.$('.job-list-container .rec-job-list')
|
const recommendJobListElProxy = await page.$('.job-list-container .rec-job-list')
|
||||||
|
|
||||||
@@ -270,6 +271,9 @@ export async function mainLoop (hooks) {
|
|||||||
targetJobIndex
|
targetJobIndex
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
} catch(err) {
|
||||||
|
reject(err)
|
||||||
|
}
|
||||||
})
|
})
|
||||||
if (targetJobIndex >= 0) {
|
if (targetJobIndex >= 0) {
|
||||||
// scroll that target element into view
|
// scroll that target element into view
|
||||||
|
|||||||
Reference in New Issue
Block a user