- Timestamp:
- 2009-09-26T10:37:00+02:00 (15 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/UploadAction.java
r2181 r2189 415 415 return; 416 416 } 417 // Tried to update or delete a primitive which never existed on 418 // the server? 419 // 420 else if (ex.getResponseCode() == HttpURLConnection.HTTP_NOT_FOUND) { 421 ExceptionDialogUtil.explainNotFound(ex); 422 return; 423 } 417 424 // any other API exception 418 425 // -
trunk/src/org/openstreetmap/josm/gui/ExceptionDialogUtil.java
r2097 r2189 133 133 134 134 /** 135 * Explains a {@see OsmApiException} which was thrown because a resource wasn't found 136 * on the server 137 * 138 * @param e the exception 139 */ 140 public static void explainNotFound(OsmApiException e) { 141 JOptionPane.showMessageDialog(Main.parent, ExceptionUtil.explainNotFound(e), tr("Not Found"), 142 JOptionPane.ERROR_MESSAGE); 143 } 144 145 /** 135 146 * Explains a {@see UnknownHostException} which has caused an {@see OsmTransferException}. 136 147 * This is most likely happening when there is an error in the API URL or when … … 216 227 return; 217 228 } 229 if (oae.getResponseCode() == HttpURLConnection.HTTP_NOT_FOUND) { 230 explainNotFound(oae); 231 return; 232 } 233 218 234 } 219 235 explainGeneric(e); -
trunk/src/org/openstreetmap/josm/io/OsmApiException.java
r2181 r2189 86 86 sb.append(tr(errorHeader)); 87 87 sb.append(tr("(Code={0})", responseCode)); 88 } else if (errorBody != null) { 88 } else if (errorBody != null && !errorBody.trim().equals("")) { 89 89 errorBody = errorBody.trim(); 90 90 sb.append(tr(errorBody)); -
trunk/src/org/openstreetmap/josm/tools/ExceptionUtil.java
r2097 r2189 168 168 message += tr("<br>Error message(untranslated): {0}", e.getErrorHeader()); 169 169 } 170 message = "<html>" + message + "</html>"; 171 e.printStackTrace(); 172 return message; 173 } 174 175 /** 176 * Explains a {@see OsmApiException} which was thrown because a resource wasn't found. 177 * 178 * @param e the exception 179 */ 180 public static String explainNotFound(OsmApiException e) { 181 String apiUrl = OsmApi.getOsmApi().getBaseUrl(); 182 String message = tr("The OSM server ''{0}'' doesn't know about an object<br>" 183 + "you tried to update or delete." 184 , apiUrl); 170 185 message = "<html>" + message + "</html>"; 171 186 e.printStackTrace();
Note:
See TracChangeset
for help on using the changeset viewer.