Welshman Docs / @welshman/lib / tryCatch
Function: tryCatch() ​
tryCatch<
T>(f,onError?):undefined|T
Defined in: packages/lib/src/Tools.ts:957
Safely executes function and handles errors
Type Parameters ​
T ​
T
Parameters ​
f ​
() => T
Function to execute
onError? ​
(e) => void
Optional error handler
Returns ​
undefined | T
Function result or undefined if error