﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
17722	Blocked user on osm.org does not receive notification, JOSM throws stack trace instead	mmd	team	"In case a user gets blocked on osm.org, the user will only receive an error message during upload, although the API User Detail call returns all relevant information (even translated according to the user's language settings). Unfortunately, JOSM doesn't parse the error message correctly and only throws some stack trace on the console.

Expected behavior would be to notify the user that they have been blocked, and that they should visit osm.org according to the message returned by the API.

Here's what the communication with the API looks like in case of a blocked user:

{{{
GET /api/0.6/user/details HTTP/1.1
User-Agent: JOSM/1.5 (15074 SVN) Linux Ubuntu 18.04.2 LTS Java/12.0.1
Cache-Control: no-cache
Accept-Encoding: gzip
Authorization: OAuth ***
Pragma: no-cache
Host: localhost:3000
Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
Connection: keep-alive
Cookie: ***

HTTP/1.1 403 Forbidden
Vary: Accept-Language, Origin
Content-Language: en
Error: Your access to the API has been blocked. Please log-in to the web interface to find out more.
Content-Type: text/plain; charset=utf-8
Cache-Control: no-cache
X-Request-Id: ***
X-Runtime: 0.043925
X-Frame-Options: sameorigin
X-Content-Type-Options: nosniff
X-XSS-Protection: 1; mode=block
X-Download-Options: noopen
X-Permitted-Cross-Domain-Policies: none
Transfer-Encoding: chunked

Your access to the API has been blocked. Please log-in to the web interface to find out more.

}}}

This is how JOSM currently handles this situation:

{{{
2019-05-16 19:24:28.754 INFO: GET http://localhost:3000/api/0.6/user/details (Anzahl der ungelesenen Nachrichten abrufen) -> 403
2019-05-16 19:24:28.755 WARNING: org.openstreetmap.josm.io.OsmApiException: ResponseCode=403, Error Header=<Your access to the API has been blocked. Please log-in to the web interface to find out more.>
org.openstreetmap.josm.io.OsmApiException: ResponseCode=403, Error Header=<Your access to the API has been blocked. Please log-in to the web interface to find out more.>
	at org.openstreetmap.josm.io.OsmServerReader.getInputStreamRaw(OsmServerReader.java:213)
	at org.openstreetmap.josm.io.OsmServerReader.getInputStreamRaw(OsmServerReader.java:137)
	at org.openstreetmap.josm.io.OsmServerReader.getInputStreamRaw(OsmServerReader.java:121)
	at org.openstreetmap.josm.io.OsmServerReader.getInputStream(OsmServerReader.java:85)
	at org.openstreetmap.josm.io.OsmServerReader.fetchData(OsmServerReader.java:421)
	at org.openstreetmap.josm.io.OsmServerUserInfoReader.fetchUserInfo(OsmServerUserInfoReader.java:170)
	at org.openstreetmap.josm.io.MessageNotifier$Worker.run(MessageNotifier.java:82)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
	at java.base/java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305)
	at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:835)

}}}
"	defect	closed	normal	19.05	Core	latest	fixed	blocked user	mmd
