Changeset 11562 in josm for trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSException.java
- Timestamp:
- 2017-02-14T23:00:03+01:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSException.java
r6987 r11562 2 2 package org.openstreetmap.josm.gui.mappaint.mapcss; 3 3 4 /** 5 * MapCSS parsing error, with line/columnn information in error message. 6 */ 4 7 public class MapCSSException extends RuntimeException { 5 8 6 protected final String specialmessage;9 /** line number at which the parse error occured */ 7 10 protected Integer line; 11 /** column number at which the parse error occured */ 8 12 protected Integer column; 9 13 14 /** 15 * Constructs a new {@code MapCSSException} with an explicit error message. 16 * @param specialmessage error message 17 */ 10 18 public MapCSSException(String specialmessage) { 11 this.specialmessage= specialmessage;19 super(specialmessage); 12 20 } 13 21 22 /** 23 * Constructs a new {@code MapCSSException} with a cause. 24 * @param cause the root cause 25 * @since 11562 26 */ 27 public MapCSSException(Throwable cause) { 28 super(cause); 29 } 30 31 /** 32 * Sets the column number at which the parse error occured. 33 * @param column the column number at which the parse error occured 34 */ 14 35 public void setColumn(int column) { 15 36 this.column = column; 16 37 } 17 38 39 /** 40 * Sets the line number at which the parse error occured. 41 * @param line the line number at which the parse error occured 42 */ 18 43 public void setLine(int line) { 19 44 this.line = line; … … 23 48 public String getMessage() { 24 49 if (line == null || column == null) 25 return s pecialmessage;26 return String.format("Error at line %s, column %s: %s", line, column, s pecialmessage);50 return super.getMessage(); 51 return String.format("Error at line %s, column %s: %s", line, column, super.getMessage()); 27 52 } 28 53 }
Note:
See TracChangeset
for help on using the changeset viewer.
