Update exception handling and logging