Catch exceptions in flush() and broadcast appropriate event.