Merge pull request #799 from CartoDB/CDB-4157

CDB-4157 Incorrect error 6666 reported by geojson file
pull/856/head
Kartones 10 years ago
commit 407b52c7c8

@ -47,14 +47,21 @@ module CartoDB
job.log "ogr2ogr output: #{ogr2ogr.command_output}"
job.log "ogr2ogr exit code: #{ogr2ogr.exit_code}"
raise InvalidGeoJSONError if ogr2ogr.command_output =~ /nrecognized GeoJSON/
raise InvalidGeoJSONError.new(job.logger) if ogr2ogr.command_output =~ /nrecognized GeoJSON/
raise MalformedCSVException.new(job.logger) if ogr2ogr.command_output =~ /tables can have at most 1600 columns/
if ogr2ogr.exit_code != 0
if (ogr2ogr.exit_code == 256 && ogr2ogr.command_output =~ /calloc failed/) || \
(ogr2ogr.exit_code == 35584 && ogr2ogr.command_output =~ /Segmentation fault/)
# OOM
if ogr2ogr.exit_code == 256 && ogr2ogr.command_output =~ /calloc failed/
raise FileTooBigError.new(job.logger)
end
# Could be OOM, could be wrong input
if ogr2ogr.exit_code == 35584 && ogr2ogr.command_output =~ /Segmentation fault/
raise LoadError.new(job.logger)
end
if ogr2ogr.exit_code == 256 && ogr2ogr.command_output =~ /Unable to open(.*)with the following drivers/
raise UnsupportedFormatError.new
raise UnsupportedFormatError.new(job.logger)
end
raise LoadError.new(job.logger)
end

Loading…
Cancel
Save