Switching exception throwing