- Problems around new request API's
This commit is contained in:
vorotamoroz committed 2022-04-20 15:02:06 +09:00
1 parent b4b9684a55
commit 9d3aa35b0b
5 files changed
+44 -34

No files matched your search

+1 -1
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) || (ex.message && ex.message == "Request Error:404") ? res(def) : rej(ex)));
p.then(res).catch((ex) => (ex.status && ex.status == 404 ? res(def) : rej(ex)));
});
}