How to enter error handling after three errors in promise handling asynchrony?

encountered an interview question, usually after an asynchronous operation error will enter. Catch (), now has to enter after three errors, how to achieve this.

Sep.20,2021

first of all, this topic is problematic. Once the Promise state is determined, it will not change, so there is no point in handling multiple errors with the same Promise .
the meaning of the comment is actually ajax request 3 times, so give me a chestnut

.
let Ajax = function(option) {
    console.log('ajax')
    return new Promise((resolve, reject) => {
        setTimeout(() => {
            reject('some error ')
            // resolve()
        }, 1000)
    })
}

function runAjax(option, retry = 2) {
    let p = Ajax(option);
    if (retry > 0) {
        retry--;
        return new Promise((resolve, reject) => {
            p.then(resolve).catch(() => {
                resolve(runAjax(option, retry))
            })
        })
    }
    return p;
}


runAjax({ hello: 'word' }).then(() => {
    console.log('success')
}).catch((err) => {
    console.log('run error', err)
})

can I say I don't understand? Is that what the interview questions are like?
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1be7a54-39c40.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1be7a54-39c40.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?