- Failure on the first sync
This commit is contained in:
vorotamoroz
2022-04-07 16:17:20 +09:00
parent 221cccb845
commit b4b9684a55
5 changed files with 12 additions and 12 deletions

View File

@@ -66,7 +66,7 @@ export const escapeStringToHTML = (str: string) => {
export function resolveWithIgnoreKnownError<T>(p: Promise<T>, def: T): Promise<T> {
return new Promise((res, rej) => {
p.then(res).catch((ex) => (ex.status && ex.status == 404 ? res(def) : rej(ex)));
p.then(res).catch((ex) => ((ex.status && ex.status == 404) || (ex.message && ex.message == "Request Error:404") ? res(def) : rej(ex)));
});
}