Add error_if_path_exists helper method