export const trytm = async ( promise: Promise ): Promise<[T, null] | [null, Error]> => { try { const data = await promise; return [data, null]; } catch (throwable) { if (throwable instanceof Error) return [null, throwable]; throw throwable; } };