UNPKG

recall_sdk

Version:

Node js sdk for the recall ai api

15 lines (13 loc) 384 B
interface RecallError { error: any; status: number; } const recallRequestTryCatchWrapper = async <T>(func: () => Promise<any>): Promise<T | RecallError> => { try { const response = await func(); return response.data; } catch (e: any) { return { error: e.response.data, status: e.response.statusCode }; } }; export { recallRequestTryCatchWrapper, RecallError };