Changeset 15089 in josm for trunk/src/org
- Timestamp:
- 2019-05-18T18:36:22+02:00 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/tools/ExceptionUtil.java
r15084 r15089 2 2 package org.openstreetmap.josm.tools; 3 3 4 import static org.openstreetmap.josm.tools.I18n.marktr;5 4 import static org.openstreetmap.josm.tools.I18n.tr; 6 5 import static org.openstreetmap.josm.tools.I18n.trn; … … 14 13 import java.text.DateFormat; 15 14 import java.text.ParseException; 15 import java.util.Arrays; 16 16 import java.util.Collection; 17 17 import java.util.Date; 18 import java.util.List; 18 19 import java.util.Objects; 19 20 import java.util.Optional; … … 45 46 46 47 /** 47 * Error message sent by the OSM API when a user has been blocked. 48 */ 49 private static final String OSM_API_BLOCKED = 50 marktr("Your access to the API has been blocked. Please log-in to the web interface to find out more."); 48 * Error messages sent by the OSM API when a user has been blocked/suspended. 49 */ 50 private static final List<String> OSM_API_BLOCK_MESSAGES = Arrays.asList( 51 "You have an urgent message on the OpenStreetMap web site. " + 52 "You need to read the message before you will be able to save your edits.", 53 "Your access to the API has been blocked. Please log-in to the web interface to find out more.", 54 "Your access to the API is temporarily suspended. Please log-in to the web interface to view the Contributor Terms." + 55 " You do not need to agree, but you must view them."); 51 56 52 57 private ExceptionUtil() { … … 723 728 724 729 /** 725 * Determines if the OSM API exception has been thrown because user has been blocked .730 * Determines if the OSM API exception has been thrown because user has been blocked or suspended. 726 731 * @param e OSM API exception 727 * @return {@code true} if the OSM API exception has been thrown because user has been blocked 732 * @return {@code true} if the OSM API exception has been thrown because user has been blocked or suspended 728 733 * @since 15084 729 734 */ 730 735 public static boolean isUserBlocked(OsmApiException e) { 731 return OSM_API_BLOCK ED.equals(e.getErrorHeader());736 return OSM_API_BLOCK_MESSAGES.contains(e.getErrorHeader()); 732 737 } 733 738
Note:
See TracChangeset
for help on using the changeset viewer.