Changeset 15085 in josm


Ignore:
Timestamp:
2019-05-18T16:34:17+02:00 (5 months ago)
Author:
Don-vip
Message:

see #17722 - make sure we don't display the same text twice

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/io/OsmApiException.java

    r15084 r15085  
    221221                sb.append(tr(header));
    222222            }
    223             if (body != null && !body.isEmpty()) {
     223            if (body != null && !body.isEmpty() && !body.equals(header)) {
    224224                if (sb.length() > 0) {
    225225                    sb.append(". ");
  • trunk/test/unit/org/openstreetmap/josm/tools/ExceptionUtilTest.java

    r15084 r15085  
    165165                "'The server replied an error with code 0.'</html>",
    166166                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>",
    168169                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>",
    170172                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>",
    172178                ExceptionUtil.explainFailedAuthorisation(new OsmApiException(HttpURLConnection.HTTP_FORBIDDEN, null, "body")));
    173179    }
Note: See TracChangeset for help on using the changeset viewer.