From c28baaab62585838a4f6a652b922d170b4cfff02 Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Mon, 30 Sep 2024 16:59:30 +0200 Subject: [PATCH] Feat: add DWG-block support --- src/Logic/Osm/ChangesetHandler.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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 }