Function
withErrorHandlingSync
(
fn: T,
context?: Record<string, any>
)
Source from the content-addressed store, hash-verified
| 92 | |
| 93 | // Wrapper for sync functions with error handling |
| 94 | export function withErrorHandlingSync<T extends (...args: any[]) => any>( |
| 95 | fn: T, |
| 96 | context?: Record<string, any> |
| 97 | ): T { |
| 98 | return ((...args: Parameters<T>) => { |
| 99 | try { |
| 100 | return fn(...args); |
| 101 | } catch (error) { |
| 102 | errorHandler.handle(error as Error, context); |
| 103 | throw error; |
| 104 | } |
| 105 | }) as T; |
| 106 | } |
Callers
nothing calls this directly
Tested by
no test coverage detected