call plugin hooks inside try..except statement