Better error handling in the IO manager thread