gitlab_monitor/utils/pbTools.ts
zhaoyingbo a4555ac862
All checks were successful
CI Monitor CI/CD / build-image (push) Successful in 29s
CI Monitor CI/CD / deploy (push) Successful in 30s
feat: 接入eslint
2024-07-24 10:56:26 +00:00

12 lines
264 B
TypeScript

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