mirror of
https://github.com/i701/sarlink-portal.git
synced 2025-04-20 07:38:20 +00:00
Some checks failed
Build and Push Docker Images / Build and Push Docker Images (push) Failing after 13m55s
9 lines
203 B
TypeScript
9 lines
203 B
TypeScript
export async function tryCatch<T, E = Error>(promise: T | Promise<T>) {
|
|
try {
|
|
const data = await promise;
|
|
return [null, data] as const;
|
|
} catch (error) {
|
|
return [error as E, null] as const;
|
|
}
|
|
}
|