catch exception in __invoke