Proper exception handling for PathUtil