Changeset 6643 in josm for trunk/src/org/openstreetmap/josm/io/remotecontrol
- Timestamp:
- 2014-01-06T16:39:45+01:00 (12 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/io/remotecontrol
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/io/remotecontrol/RemoteControlHttpServer.java
r6248 r6643 40 40 Integer.toString(port), ex.getLocalizedMessage()); 41 41 } catch (IOException ioe) { 42 ioe.printStackTrace();42 Main.error(ioe); 43 43 } 44 44 } … … 54 54 instance = null; 55 55 } catch (IOException ioe) { 56 ioe.printStackTrace();56 Main.error(ioe); 57 57 } 58 58 } … … 64 64 * @throws IOException when connection errors 65 65 */ 66 public RemoteControlHttpServer(int port) 67 throws IOException 68 { 66 public RemoteControlHttpServer(int port) throws IOException { 69 67 super("RemoteControl HTTP Server"); 70 68 this.setDaemon(true); … … 81 79 */ 82 80 @Override 83 public void run() 84 { 81 public void run() { 85 82 Main.info(marktr("RemoteControl::Accepting connections on port {0}"), 86 83 Integer.toString(server.getLocalPort())); 87 while (true) 88 { 89 try 90 { 84 while (true) { 85 try { 91 86 Socket request = server.accept(); 92 87 RequestProcessor.processRequest(request); 93 } 94 catch( SocketException se) 95 { 88 } catch( SocketException se) { 96 89 if( !server.isClosed() ) 97 se.printStackTrace(); 98 } 99 catch (IOException ioe) 100 { 101 ioe.printStackTrace(); 90 Main.error(se); 91 } catch (IOException ioe) { 92 Main.error(ioe); 102 93 } 103 94 } … … 109 100 * @throws IOException 110 101 */ 111 public void stopServer() throws IOException 112 { 102 public void stopServer() throws IOException { 113 103 server.close(); 114 104 Main.info(marktr("RemoteControl::Server stopped.")); -
trunk/src/org/openstreetmap/josm/io/remotecontrol/RequestProcessor.java
r6536 r6643 240 240 241 241 } catch (IOException ioe) { 242 Main.debug(Main.getErrorMessage(ioe)); 242 243 } catch (Exception e) { 243 e.printStackTrace();244 Main.error(e); 244 245 try { 245 246 sendError(out); … … 250 251 request.close(); 251 252 } catch (IOException e) { 253 Main.debug(Main.getErrorMessage(e)); 252 254 } 253 255 } … … 389 391 handler = handlers.get(cmd).newInstance(); 390 392 } catch (Exception ex) { 391 ex.printStackTrace();393 Main.error(ex); 392 394 return null; 393 395 } … … 450 452 * @return HTML message with the description of all available commands 451 453 * @throws IllegalAccessException 452 * @throws InstantiationException 454 * @throws InstantiationException 453 455 */ 454 456 public static String getUsageAsHtml() throws IllegalAccessException, InstantiationException { -
trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/ImportHandler.java
r6536 r6643 36 36 } catch (Exception ex) { 37 37 Main.warn("RemoteControl: Error parsing import remote control request:"); 38 ex.printStackTrace();38 Main.error(ex); 39 39 throw new RequestHandlerErrorException(); 40 40 } -
trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/LoadAndZoomHandler.java
r6536 r6643 89 89 public String[] getUsageExamples(String cmd) { 90 90 if (command.equals(cmd)) { 91 return new String[] { 91 return new String[] { 92 92 "/load_and_zoom?addtags=wikipedia:de=Wei%C3%9Fe_Gasse|maxspeed=5&select=way23071688,way23076176,way23076177,&left=13.740&right=13.741&top=51.05&bottom=51.049", 93 93 "/load_and_zoom?left=8.19&right=8.20&top=48.605&bottom=48.590&select=node413602999&new_layer=true"}; 94 94 } else { 95 return new String[] { 95 return new String[] { 96 96 "/zoom?left=8.19&right=8.20&top=48.605&bottom=48.590&select=node413602999"}; 97 97 } … … 139 139 } catch (Exception ex) { 140 140 Main.warn("RemoteControl: Error parsing load_and_zoom remote control request:"); 141 ex.printStackTrace();141 Main.error(ex); 142 142 throw new RequestHandlerErrorException(); 143 143 }
Note:
See TracChangeset
for help on using the changeset viewer.