Ticket #1810: 20081201uploadissuesjosm.diff

File 20081201uploadissuesjosm.diff, 2.4 KB (added by smsm1, 16 years ago)

some comments on the changes required

  • src/org/openstreetmap/josm/io/OsmServerWriter.java

     
    222222                        activeConnection.disconnect();
    223223                        if (retCode == 404)
    224224                        {
    225                                 System.out.println("Server does not support changesets, continuing");
     225                                System.out.println("Server does not support changesets, or the changeset was not found, continuing");
    226226                                return true;
    227227                        }
    228228                        if (retCode != 200 && retCode != 412) {
     
    238238                                // Look for a detailed error message from the server
    239239                                if (activeConnection.getHeaderField("Error") != null)
    240240                                    retMsg += "\n" + activeConnection.getHeaderField("Error");
     241// No error header is actually returned, look at the std payload
    241242
    242243                                // Report our error
    243244                                ByteArrayOutputStream o = new ByteArrayOutputStream();
     
    345346                    // Look for a detailed error message from the server
    346347                    if (activeConnection.getHeaderField("Error") != null)
    347348                        retMsg += "\n" + activeConnection.getHeaderField("Error");
     349// No error header is actually returned, look at the std payload
    348350
    349351                    // Report our error
    350352                    ByteArrayOutputStream o = new ByteArrayOutputStream();
     
    416418                        int retCode = activeConnection.getResponseCode();
    417419                        if (retCode == 200)
    418420                                changeset.id = readId(activeConnection.getInputStream());
     421      // wtf we already have the id of the changeset, which isn't returned by the api when we are closing the changeset
    419422                        System.out.println("got return: "+retCode+" with id "+changeset.id);
    420423                        String retMsg = activeConnection.getResponseMessage();
    421424                        activeConnection.disconnect();
    422425                        if (retCode == 404)
    423426                        {
    424                                 System.out.println("Server does not support changesets, continuing");
     427                                System.out.println("Server does not support changesets, or the changeset could not be found, continuing");
    425428                                return;
    426429                        }
    427430                        if (retCode != 200 && retCode != 412) {
     
    435438                                        // Look for a detailed error message from the server
    436439                                        if (activeConnection.getHeaderField("Error") != null)
    437440                                                retMsg += "\n" + activeConnection.getHeaderField("Error");
     441// No error header is actually returned, look at the std payload
    438442
    439443                                        // Report our error
    440444                                        ByteArrayOutputStream o = new ByteArrayOutputStream();