Improve error handling in log viewer