Centralized exception handling.