Ignore:
Timestamp:
2014-01-06T15:57:41+01:00 (12 years ago)
Author:
Don-vip
Message:

Improve handling of network errors at startup, suggest to change proxy settings

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/tools/Utils.java

    r6623 r6642  
    419419            return true;
    420420        } catch (IllegalStateException ex) {
    421             ex.printStackTrace();
     421            Main.error(ex);
    422422            return false;
    423423        }
     
    449449            }
    450450        } catch (UnsupportedFlavorException ex) {
    451             ex.printStackTrace();
     451            Main.error(ex);
    452452            return null;
    453453        } catch (IOException ex) {
    454             ex.printStackTrace();
     454            Main.error(ex);
    455455            return null;
    456456        }
     
    895895    }
    896896
     897    /**
     898     * Returns the root cause of a throwable object.
     899     * @param t The object to get root cause for
     900     * @return the root cause of {@code t}
     901     * @since 6639
     902     */
     903    public static Throwable getRootCause(Throwable t) {
     904        Throwable result = t;
     905        if (result != null) {
     906            Throwable cause = result.getCause();
     907            while (cause != null && cause != result) {
     908                result = cause;
     909                cause = result.getCause();
     910            }
     911        }
     912        return result;
     913    }
    897914}
Note: See TracChangeset for help on using the changeset viewer.