Wrap all functions in try-catch with custom handler