Improve script to handle errors

This commit is contained in:
Pieter Vander Vennet 2024-08-24 01:50:55 +02:00
parent d28acfdb20
commit 3079bbb934
2 changed files with 101 additions and 69 deletions

View file

@ -266,7 +266,8 @@ export class Changes {
public CreateChangesetObjects(
changes: ChangeDescription[],
downloadedOsmObjects: OsmObject[]
downloadedOsmObjects: OsmObject[],
ignoreNoCreate: boolean = false
): {
newObjects: OsmObject[]
modifiedObjects: OsmObject[]
@ -314,6 +315,9 @@ export class Changes {
}
if (change.changes === undefined) {
// This object is a change to a newly created object. However, we have not seen the creation changedescription yet!
if(ignoreNoCreate){
continue
}
throw "Not a creation of the object: " + JSON.stringify(change)
}
// This is a new object that should be created