Ignore:
Timestamp:
2014-01-06T16:39:45+01:00 (12 years ago)
Author:
Don-vip
Message:

global replacement of e.printStackTrace() by Main.error(e)

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  
    4040                    Integer.toString(port), ex.getLocalizedMessage());
    4141        } catch (IOException ioe) {
    42             ioe.printStackTrace();
     42            Main.error(ioe);
    4343        }
    4444    }
     
    5454                instance = null;
    5555            } catch (IOException ioe) {
    56                 ioe.printStackTrace();
     56                Main.error(ioe);
    5757            }
    5858        }
     
    6464     * @throws IOException when connection errors
    6565     */
    66     public RemoteControlHttpServer(int port)
    67         throws IOException
    68     {
     66    public RemoteControlHttpServer(int port) throws IOException {
    6967        super("RemoteControl HTTP Server");
    7068        this.setDaemon(true);
     
    8179     */
    8280    @Override
    83     public void run()
    84     {
     81    public void run() {
    8582        Main.info(marktr("RemoteControl::Accepting connections on port {0}"),
    8683             Integer.toString(server.getLocalPort()));
    87         while (true)
    88         {
    89             try
    90             {
     84        while (true) {
     85            try {
    9186                Socket request = server.accept();
    9287                RequestProcessor.processRequest(request);
    93             }
    94             catch( SocketException se)
    95             {
     88            } catch( SocketException se) {
    9689                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);
    10293            }
    10394        }
     
    109100     * @throws IOException
    110101     */
    111     public void stopServer() throws IOException
    112     {
     102    public void stopServer() throws IOException {
    113103        server.close();
    114104        Main.info(marktr("RemoteControl::Server stopped."));
  • trunk/src/org/openstreetmap/josm/io/remotecontrol/RequestProcessor.java

    r6536 r6643  
    240240
    241241        } catch (IOException ioe) {
     242            Main.debug(Main.getErrorMessage(ioe));
    242243        } catch (Exception e) {
    243             e.printStackTrace();
     244            Main.error(e);
    244245            try {
    245246                sendError(out);
     
    250251                request.close();
    251252            } catch (IOException e) {
     253                Main.debug(Main.getErrorMessage(e));
    252254            }
    253255        }
     
    389391            handler = handlers.get(cmd).newInstance();
    390392        } catch (Exception ex) {
    391             ex.printStackTrace();
     393            Main.error(ex);
    392394            return null;
    393395        }
     
    450452     * @return HTML message with the description of all available commands
    451453     * @throws IllegalAccessException
    452      * @throws InstantiationException 
     454     * @throws InstantiationException
    453455     */
    454456    public static String getUsageAsHtml() throws IllegalAccessException, InstantiationException {
  • trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/ImportHandler.java

    r6536 r6643  
    3636        } catch (Exception ex) {
    3737            Main.warn("RemoteControl: Error parsing import remote control request:");
    38             ex.printStackTrace();
     38            Main.error(ex);
    3939            throw new RequestHandlerErrorException();
    4040        }
  • trunk/src/org/openstreetmap/josm/io/remotecontrol/handler/LoadAndZoomHandler.java

    r6536 r6643  
    8989    public String[] getUsageExamples(String cmd) {
    9090        if (command.equals(cmd)) {
    91             return new String[] { 
     91            return new String[] {
    9292                    "/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",
    9393                    "/load_and_zoom?left=8.19&right=8.20&top=48.605&bottom=48.590&select=node413602999&new_layer=true"};
    9494        } else {
    95             return new String[] { 
     95            return new String[] {
    9696            "/zoom?left=8.19&right=8.20&top=48.605&bottom=48.590&select=node413602999"};
    9797        }
     
    139139        } catch (Exception ex) {
    140140            Main.warn("RemoteControl: Error parsing load_and_zoom remote control request:");
    141             ex.printStackTrace();
     141            Main.error(ex);
    142142            throw new RequestHandlerErrorException();
    143143        }
Note: See TracChangeset for help on using the changeset viewer.