You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm used to it from fp-ts but the function signature here is slightly different. I also hadn't been aware of waitUntil from @vercel/functions - perhaps we could add in which external dependencies are being relied on here, just to save people some mental overhead?
The text was updated successfully, but these errors were encountered:
/** Attempts to execute a promise and returns an object with the result or error. */exportasyncfunctiontryCatch<T>(promise: Promise<T>): Promise<{data?: T;error?: Error;}>{try{constdata=awaitpromise;return{ data };}catch(error){if(errorinstanceofError){return{ error };}// Handle non-Error throws by wrapping themreturn{error: newError(String(error))};}}
I'm used to it from
fp-ts
but the function signature here is slightly different. I also hadn't been aware ofwaitUntil
from@vercel/functions
- perhaps we could add in which external dependencies are being relied on here, just to save people some mental overhead?The text was updated successfully, but these errors were encountered: