catch exceptions during flush for web responses