diff --git a/src/Logic/Osm/ChangesetHandler.ts b/src/Logic/Osm/ChangesetHandler.ts index 7add28b64..33d336765 100644 --- a/src/Logic/Osm/ChangesetHandler.ts +++ b/src/Logic/Osm/ChangesetHandler.ts @@ -205,10 +205,19 @@ export class ChangesetHandler { try { return await this.UploadWithNew(generateChangeXML, openChangeset, extraMetaTags) } catch (e) { + const req = (e) + if (req.status === 403) { + // Someone got the banhammer + // This is the message that OSM returned, will be something like "you have an important message, go to osm.org" + const msg = req.responseText + alert(msg+"\n\nWe'll take you to openstreetmap.org now") + window.location.replace(this.osmConnection.Backend()) + return + } if (this._reportError) { this._reportError(e, "While opening a new changeset") } - if ((e).status === 400) { + if (req.status === 400) { // This request is invalid. We simply drop the changes and hope that someone will analyze what went wrong with it in the upload; we pretend everything went fine return }