Unified error handling.