11 lines
268 B
TypeScript
11 lines
268 B
TypeScript
export const managePb404 = async (dbFunc: Function) => {
|
|
try {
|
|
return await dbFunc();
|
|
} catch (err: any) {
|
|
// 没有这个提醒就返回空
|
|
if (err?.message === "The requested resource wasn't found.") {
|
|
return null;
|
|
} else throw err;
|
|
}
|
|
};
|