Changeset 4834 in josm for trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/RequestHandler.java
- Timestamp:
- 2012-01-21T12:07:57+01:00 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/RequestHandler.java
r4191 r4834 5 5 6 6 import java.util.HashMap; 7 import java.util.LinkedList; 8 import java.util.List; 7 9 import java.util.StringTokenizer; 8 10 … … 11 13 import org.openstreetmap.josm.Main; 12 14 import org.openstreetmap.josm.io.remotecontrol.PermissionPrefWithDefault; 15 import org.openstreetmap.josm.tools.Utils; 13 16 14 17 /** … … 91 94 } 92 95 93 protected String[] getMandatoryParams() 94 { 96 public String[] getMandatoryParams() { 95 97 return null; 96 98 } … … 169 171 if(mandatory == null) return; 170 172 173 List<String> missingKeys = new LinkedList<String>(); 171 174 boolean error = false; 172 175 for (int i = 0; i < mandatory.length; ++i) { … … 176 179 error = true; 177 180 System.out.println("'" + myCommand + "' remote control request must have '" + key + "' parameter"); 181 missingKeys.add(key); 178 182 } 179 183 } 180 if (error) 181 throw new RequestHandlerBadRequestException(); 184 if (error) { 185 throw new RequestHandlerBadRequestException( 186 "The following keys are mandatory, but have not been provided: " 187 + Utils.join(", ", missingKeys)); 188 } 182 189 } 183 190 … … 204 211 205 212 public static class RequestHandlerException extends Exception { 213 214 public RequestHandlerException(String message) { 215 super(message); 216 } 217 218 public RequestHandlerException() { 219 } 206 220 } 207 221 … … 210 224 211 225 public static class RequestHandlerBadRequestException extends RequestHandlerException { 226 227 public RequestHandlerBadRequestException(String message) { 228 super(message); 229 } 212 230 } 213 231
Note:
See TracChangeset
for help on using the changeset viewer.