OSM-es / CatAtom2Osm

Tool to convert INSPIRE data sets from the Spanish Cadastre ATOM Services to OSM files.
BSD 2-Clause "Simplified" License
13 stars 6 forks source link

Añadir excepciones propias #97

Closed javiersanp closed 2 years ago

javiersanp commented 2 years ago

En lugar de reutilizar las internas de Python para diferenciar salidas con error normales de excepciones de código.

catatom2osm/main.py: log.error(("Can't use split file with multiple municipalities")) catatom2osm/main.py: log.error(msg) catatom2osm/main.py: raise ValueError(("Province code '%s' not valid") % provcode) catatom2osm/app.py: raise ValueError(msg) catatom2osm/app.py: raise(ValueError(msg)) catatom2osm/app.py: raise ValueError(("No parcels data")) catatom2osm/app.py: raise ValueError(("No buildings data")) catatom2osm/app.py: raise ValueError(msg) catatom2osm/app.py: raise ValueError(("No parcels data")) catatom2osm/app.py: raise ValueError(("No buildings data")) catatom2osm/app.py: raise ValueError(("No addresses data")) catatom2osm/catatom.py: raise ValueError(("Last directory name must be a 5 digits ZIP code")) catatom2osm/catatom.py: raise ValueError(msg) catatom2osm/catatom.py: raise ValueError(("Zip code '%s' don't exists") % self.zipcode) catatom2osm/catatom.py: raise ValueError(("Unknow layer name '%s'") % layername) catatom2osm/cdau.py: raise ValueError(_("Province code '%s' not valid") % prov_code)

catatom2osm/geo/layer/base.py: raise IOError(msg) catatom2osm/cdau.py: raise IOError(_("Not a directory: '%s'") % apath) catatom2osm/cdau.py: raise IOError(("Could not read metadata from '%s'") % 'CDAU') catatom2osm/cdau.py: raise IOError(_("Failed to load layer '%s'") % csvpath) catatom2osm/osm.py: raise AttributeError catatom2osm/osm.py: raise IndexError catatom2osm/app.py: raise IOError("Can't open %s" % self.options.split) catatom2osm/app.py: raise IOError(msg) catatom2osm/app.py: raise IOError(("Failed to write layer: '%s'") % filename) catatom2osm/csvtools.py: raise IOError(msg) catatom2osm/csvtools.py: raise IOError(msg) catatom2osm/overpass.py: raise IOError("Can't read from any Overpass server'") catatom2osm/catatom.py: raise IOError(_("Not a directory: '%s'") % apath) catatom2osm/catatom.py: raise IOError(("Could not read metadata from '%s'") % mdpath) catatom2osm/catatom.py: raise IOError(("Could not read metadata from '%s'") % mdpath) catatom2osm/catatom.py: raise IOError(("The layer '%s' is empty") % gmlpath) catatom2osm/catatom.py: raise IOError(("Failed to load layer '%s'") % gmlpath) catatom2osm/catatom.py: raise IOError(("Could not determine the CRS of '%s'") % gml_path)

catatom2osm/overpass.py: raise TypeError(msg % search_area)

catatom2osm/catatom.py: raise KeyError("There is no item named '{}' in the archive".format(fn))