Changeset 13207 in josm for trunk/src/org
- Timestamp:
- 2017-12-17T01:25:46+01:00 (7 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/MapRendererFactory.java
r12846 r13207 6 6 import java.awt.Graphics2D; 7 7 import java.lang.reflect.Constructor; 8 import java.lang.reflect.InvocationTargetException;9 8 import java.text.MessageFormat; 10 9 import java.util.ArrayList; … … 307 306 Constructor<?> c = activeRenderer.getConstructor(Graphics2D.class, NavigatableComponent.class, boolean.class); 308 307 return AbstractMapRenderer.class.cast(c.newInstance(g, viewport, isInactiveMode)); 309 } catch (InvocationTargetException e) {310 Logging.debug(e);311 throw new MapRendererFactoryException(e.getCause());312 308 } catch (ReflectiveOperationException | IllegalArgumentException e) { 313 309 throw new MapRendererFactoryException(e); -
trunk/src/org/openstreetmap/josm/data/projection/ProjectionCLI.java
r12892 r13207 196 196 return Double.parseDouble(s); 197 197 } catch (NumberFormatException nfe) { 198 throw new IllegalArgumentException(tr("Unable to parse number ''{0}''", s) );198 throw new IllegalArgumentException(tr("Unable to parse number ''{0}''", s), nfe); 199 199 } 200 200 } -
trunk/src/org/openstreetmap/josm/gui/mappaint/RenderingCLI.java
r13204 r13207 231 231 } catch (NumberFormatException nfe) { 232 232 throw new IllegalArgumentException( 233 tr("Expected integer number for option {0}, but got ''{1}''", "--zoom", getopt.getOptarg()) );233 tr("Expected integer number for option {0}, but got ''{1}''", "--zoom", getopt.getOptarg()), nfe); 234 234 } 235 235 if (argZoom < 0) … … 242 242 argBounds = new Bounds(getopt.getOptarg(), ",", Bounds.ParseMethod.LEFT_BOTTOM_RIGHT_TOP, false); 243 243 } catch (IllegalArgumentException iae) { // NOPMD 244 throw new IllegalArgumentException(tr("Unable to parse {0} parameter: {1}", "--bounds", iae.getMessage()) );244 throw new IllegalArgumentException(tr("Unable to parse {0} parameter: {1}", "--bounds", iae.getMessage()), iae); 245 245 } 246 246 } … … 268 268 } catch (NumberFormatException nfe) { 269 269 throw new IllegalArgumentException( 270 tr("Expected floating point number for option {0}, but got ''{1}''", "--scale", getopt.getOptarg()) );270 tr("Expected floating point number for option {0}, but got ''{1}''", "--scale", getopt.getOptarg()), nfe); 271 271 } 272 272 break; … … 282 282 argAnchor = new LatLon(lat, lon); 283 283 } catch (IllegalArgumentException iae) { // NOPMD 284 throw new IllegalArgumentException(tr("In option {0}: {1}", "--anchor", iae.getMessage()) );284 throw new IllegalArgumentException(tr("In option {0}: {1}", "--anchor", iae.getMessage()), iae); 285 285 } 286 286 break; … … 290 290 } catch (NumberFormatException nfe) { 291 291 throw new IllegalArgumentException( 292 tr("Expected floating point number for option {0}, but got ''{1}''", "--width-m", getopt.getOptarg()) );292 tr("Expected floating point number for option {0}, but got ''{1}''", "--width-m", getopt.getOptarg()), nfe); 293 293 } 294 294 if (argWidthM <= 0) throw new IllegalArgumentException( … … 300 300 } catch (NumberFormatException nfe) { 301 301 throw new IllegalArgumentException( 302 tr("Expected floating point number for option {0}, but got ''{1}''", "--height-m", getopt.getOptarg()) );302 tr("Expected floating point number for option {0}, but got ''{1}''", "--height-m", getopt.getOptarg()), nfe); 303 303 } 304 304 if (argHeightM <= 0) throw new IllegalArgumentException( … … 310 310 } catch (NumberFormatException nfe) { 311 311 throw new IllegalArgumentException( 312 tr("Expected integer number for option {0}, but got ''{1}''", "--width-px", getopt.getOptarg()) );312 tr("Expected integer number for option {0}, but got ''{1}''", "--width-px", getopt.getOptarg()), nfe); 313 313 } 314 314 if (argWidthPx <= 0) throw new IllegalArgumentException( … … 320 320 } catch (NumberFormatException nfe) { 321 321 throw new IllegalArgumentException( 322 tr("Expected integer number for option {0}, but got ''{1}''", "--height-px", getopt.getOptarg()) );322 tr("Expected integer number for option {0}, but got ''{1}''", "--height-px", getopt.getOptarg()), nfe); 323 323 } 324 324 if (argHeightPx <= 0) throw new IllegalArgumentException( … … 333 333 } catch (NumberFormatException nfe) { 334 334 throw new IllegalArgumentException( 335 tr("Expected integer number for option {0}, but got ''{1}''", "--max-image-size", getopt.getOptarg()) );335 tr("Expected integer number for option {0}, but got ''{1}''", "--max-image-size", getopt.getOptarg()), nfe); 336 336 } 337 337 if (argMaxImageSize < 0) throw new IllegalArgumentException( … … 551 551 return OsmReader.parseDataSet(Files.newInputStream(Paths.get(argInput)), null); 552 552 } catch (IllegalDataException e) { 553 throw new IllegalDataException(tr("In .osm data file ''{0}'' - ", argInput) + e.getMessage() );553 throw new IllegalDataException(tr("In .osm data file ''{0}'' - ", argInput) + e.getMessage(), e); 554 554 } 555 555 } -
trunk/src/org/openstreetmap/josm/gui/oauth/OsmOAuthAuthorizationClient.java
r12620 r13207 328 328 throw new OsmOAuthAuthorizationException(tr("Failed to authenticate user ''{0}'' with password ''***'' as OAuth user", 329 329 userName)); 330 } catch (OsmOAuthAuthorizationException e) { 331 Logging.debug(e); 332 throw new OsmLoginFailedException(e.getCause()); 333 } catch (IOException e) { 330 } catch (OsmOAuthAuthorizationException | IOException e) { 334 331 throw new OsmLoginFailedException(e); 335 332 } finally { -
trunk/src/org/openstreetmap/josm/io/ChangesetClosedException.java
r12620 r13207 98 98 99 99 /** 100 * Creates the exception with the given error header and the given 101 * source. 100 * Creates the exception with the given error header and source. 102 101 * 103 102 * @param errorHeader the error header … … 105 104 */ 106 105 public ChangesetClosedException(String errorHeader, Source source) { 107 super(errorHeader); 106 this(errorHeader, source, null); 107 } 108 109 /** 110 * Creates the exception with the given error header, source and cause. 111 * 112 * @param errorHeader the error header 113 * @param source the source for the exception 114 * @param cause The cause (which is saved for later retrieval by the {@link #getCause} method). 115 * A null value is permitted, and indicates that the cause is nonexistent or unknown. 116 * @since 13207 117 */ 118 public ChangesetClosedException(String errorHeader, Source source, Throwable cause) { 119 super(errorHeader, cause); 108 120 parseErrorHeader(errorHeader); 109 121 this.source = source == null ? Source.UNSPECIFIED : source; -
trunk/src/org/openstreetmap/josm/io/OsmApi.java
r12992 r13207 487 487 String errorHeader = e.getErrorHeader(); 488 488 if (e.getResponseCode() == HttpURLConnection.HTTP_CONFLICT && ChangesetClosedException.errorHeaderMatchesPattern(errorHeader)) 489 throw new ChangesetClosedException(errorHeader, ChangesetClosedException.Source.UPDATE_CHANGESET );489 throw new ChangesetClosedException(errorHeader, ChangesetClosedException.Source.UPDATE_CHANGESET, e); 490 490 throw e; 491 491 } finally {
Note:
See TracChangeset
for help on using the changeset viewer.