Skip to content

pyosmium-up-to-date give a strange message when no update to do #160

@jocelynj

Description

@jocelynj

When launching pyosmium-up-to-date on a pbf, and no update is available from the server, the command reports an error on a state file, instead of reporting that no update is available.

$ wget http://download.geofabrik.de/europe/andorra-latest.osm.pbf
$ pyosmium-up-to-date -vvvvv andorra-latest.osm.pbf 
2020-12-10 22:04:11,336 DEBUG: Replication information found in OSM file header.
2020-12-10 22:04:11,336 DEBUG: Replication URL: http://download.geofabrik.de/europe/andorra-updates
2020-12-10 22:04:11,336 DEBUG: Replication sequence: 2817
2020-12-10 22:04:11,336 DEBUG: Replication timestamp: 2020-12-09T21:42:03Z
2020-12-10 22:04:11,338 INFO: Using replication service at http://download.geofabrik.de/europe/andorra-updates
2020-12-10 22:04:11,338 DEBUG: Using given sequence ID 2817
2020-12-10 22:04:11,406 DEBUG: Loading state info 2818 failed with: HTTP Error 404: Not Found
2020-12-10 22:04:11,408 ERROR: Cannot download state information for ID 2817. Is the URL correct?

I would expect to print the message "No new updates found." instead.

In addition, would it be possible to generate a different error code when no update is available? It would be useful to check if we should rerun the script or not, in case of a transient serveur connection issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions