gitlab_monitor/utils/pbTools.ts
zhaoyingbo 6cb7a26ad5
All checks were successful
CI Monitor CI/CD / build-image (push) Successful in 23s
CI Monitor CI/CD / deploy (push) Successful in 35s
feat: 优化统计信息获取逻辑
2024-05-21 06:41:33 +00:00

10 lines
252 B
TypeScript

export const managePb404 = async <T>(dbFunc: Function): Promise<T | null> => {
try {
return await dbFunc();
} catch (err: any) {
if (err?.message === "The requested resource wasn't found.") {
return null;
} else throw err;
}
};