Changeset 18283 in josm for trunk/src/org/openstreetmap/josm/io
- Timestamp:
- 2021-10-17T15:17:42+02:00 (3 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/io
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/io/ChangesetClosedException.java
r17840 r18283 31 31 public static final String ERROR_HEADER_PATTERN = "The changeset (\\d+) was closed at (.*)"; 32 32 33 /** 34 * Identifies when the changeset exception occurred. 35 */ 33 36 public enum Source { 34 37 /** … … 43 46 */ 44 47 UPLOAD_DATA, 48 /** 49 * The exception was thrown when we tried to close a changeset. Probably the changeset 50 * already timed out on the server. 51 * @since 18283 52 */ 53 CLOSE_CHANGESET, 45 54 /** 46 55 * Unspecified source … … 163 172 } 164 173 174 /** 175 * Sets the source where the exception was thrown 176 * 177 * @param source the source where the exception was thrown 178 */ 165 179 public void setSource(Source source) { 166 180 this.source = source == null ? Source.UNSPECIFIED : source; -
trunk/src/org/openstreetmap/josm/io/OsmApi.java
r17506 r18283 388 388 } 389 389 } 390 } catch (ChangesetClosedException e) { 391 e.setSource(ChangesetClosedException.Source.UPDATE_CHANGESET); 392 throw e; 390 393 } catch (NumberFormatException e) { 391 394 throw new OsmTransferException(errHandler.apply(ret), e); … … 529 532 // send "\r\n" instead of empty string, so we don't send zero payload - workaround bugs in proxy software 530 533 sendPutRequest("changeset/" + changeset.getId() + "/close", "\r\n", monitor); 534 } catch (ChangesetClosedException e) { 535 e.setSource(ChangesetClosedException.Source.CLOSE_CHANGESET); 536 throw e; 537 } finally { 531 538 changeset.setOpen(false); 532 } finally {533 539 monitor.finishTask(); 534 540 } … … 565 571 throws OsmTransferException { 566 572 try { 573 ensureValidChangeset(); 567 574 monitor.beginTask("", list.size() * 2); 568 if (changeset == null)569 throw new OsmTransferException(tr("No changeset present for diff upload."));570 575 571 576 initialize(monitor); … … 594 599 monitor.createSubTaskMonitor(ProgressMonitor.ALL_TICKS, false) 595 600 ); 596 } catch (OsmTransferException e) { 601 } catch (ChangesetClosedException e) { 602 e.setSource(ChangesetClosedException.Source.UPLOAD_DATA); 597 603 throw e; 598 604 } catch (XmlParsingException e) { … … 752 758 case HttpURLConnection.HTTP_CONFLICT: 753 759 if (ChangesetClosedException.errorHeaderMatchesPattern(errorHeader)) 754 throw new ChangesetClosedException(errorBody, ChangesetClosedException.Source.U PLOAD_DATA);760 throw new ChangesetClosedException(errorBody, ChangesetClosedException.Source.UNSPECIFIED); 755 761 else 756 762 throw new OsmApiException(retCode, errorHeader, errorBody); -
trunk/src/org/openstreetmap/josm/io/UploadStrategySpecification.java
r12687 r18283 151 151 152 152 @Override 153 public String toString() { 154 return String.format("Strategy: %s, ChunkSize: %d, Policy: %s, Close after: %b", 155 strategy.toString(), chunkSize, policy == null ? "none" : policy.toString(), closeChangesetAfterUpload); 156 } 157 158 @Override 153 159 public int hashCode() { 154 160 return Objects.hash(strategy, chunkSize, policy, closeChangesetAfterUpload);
Note:
See TracChangeset
for help on using the changeset viewer.