Catch correct exception when path is not resolved.