Better exception handling for non-matched package