Changeset 15085 in josm
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/io/OsmApiException.java
r15084 r15085 221 221 sb.append(tr(header)); 222 222 } 223 if (body != null && !body.isEmpty()) { 223 if (body != null && !body.isEmpty() && !body.equals(header)) { 224 224 if (sb.length() > 0) { 225 225 sb.append(". "); -
trunk/test/unit/org/openstreetmap/josm/tools/ExceptionUtilTest.java
r15084 r15085 165 165 "'The server replied an error with code 0.'</html>", 166 166 ExceptionUtil.explainFailedAuthorisation(new OsmApiException(""))); 167 assertEquals("<html>Authorisation at the OSM server failed.<br>The server reported the following error:<br>'header (Code=403)'</html>", 167 assertEquals("<html>Authorisation at the OSM server failed.<br>The server reported the following error:<br>"+ 168 "'header (Code=403)'</html>", 168 169 ExceptionUtil.explainFailedAuthorisation(new OsmApiException(HttpURLConnection.HTTP_FORBIDDEN, "header", null))); 169 assertEquals("<html>Authorisation at the OSM server failed.<br>The server reported the following error:<br>'header. body (Code=403)'</html>", 170 assertEquals("<html>Authorisation at the OSM server failed.<br>The server reported the following error:"+ 171 "<br>'header. body (Code=403)'</html>", 170 172 ExceptionUtil.explainFailedAuthorisation(new OsmApiException(HttpURLConnection.HTTP_FORBIDDEN, "header", "body"))); 171 assertEquals("<html>Authorisation at the OSM server failed.<br>The server reported the following error:<br>'body (Code=403)'</html>", 173 assertEquals("<html>Authorisation at the OSM server failed.<br>The server reported the following error:"+ 174 "<br>'header_body (Code=403)'</html>", 175 ExceptionUtil.explainFailedAuthorisation(new OsmApiException(HttpURLConnection.HTTP_FORBIDDEN, "header_body", "header_body"))); 176 assertEquals("<html>Authorisation at the OSM server failed.<br>The server reported the following error:<br>"+ 177 "'body (Code=403)'</html>", 172 178 ExceptionUtil.explainFailedAuthorisation(new OsmApiException(HttpURLConnection.HTTP_FORBIDDEN, null, "body"))); 173 179 }
Note:
See TracChangeset
for help on using the changeset viewer.
