X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/c3f1d34b714c0410652bfa2e28fe3f6e5f9ea1aa..cce0e5ea38fe3466e157651e789554d99fbdc8fe:/nominatim/clicmd/refresh.py?ds=sidebyside diff --git a/nominatim/clicmd/refresh.py b/nominatim/clicmd/refresh.py index 4fbdfebb..ecc7498e 100644 --- a/nominatim/clicmd/refresh.py +++ b/nominatim/clicmd/refresh.py @@ -7,6 +7,7 @@ """ Implementation of 'refresh' subcommand. """ +from argparse import ArgumentTypeError import logging from pathlib import Path @@ -24,7 +25,7 @@ def _parse_osm_object(obj): Raises an ArgumentError if the format is not recognized. """ if len(obj) < 2 or obj[0].lower() not in 'nrw' or not obj[1:].isdigit(): - raise ArgumentError("Expect OSM object id of form [N|W|R].") + raise ArgumentTypeError("Cannot parse OSM ID. Expect format: [N|W|R].") return (obj[0].upper(), int(obj[1:])) @@ -79,7 +80,7 @@ class UpdateRefresh: help='Enable debug warning statements in functions') - def run(self, args): + def run(self, args): #pylint: disable=too-many-branches from ..tools import refresh, postcodes from ..indexer.indexer import Indexer