Show
Ignore:
Timestamp:
09/04/10 09:06:26 (21 months ago)
Author:
stefan
Message:

added error popup

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/jlatexeditor/tools/SVN.java

    r834 r835  
    2626 
    2727    Process svn; 
    28     try { 
    29       svn = ProcessUtil.exec(new String[]{"svn", "--non-interactive", "update"}, dir); 
    30     } catch (Exception e) { 
    31       e.printStackTrace(); 
    32       throw new Exception("SVN update failed!", e); 
    33     } 
     28    svn = ProcessUtil.exec(new String[]{"svn", "--non-interactive", "update"}, dir); 
    3429 
    3530    BufferedReader in = new BufferedReader(new InputStreamReader(svn.getInputStream()), 100000); 
     
    6762  } 
    6863 
    69   /** 
    70    * Check if the return code of the svn process is OK. 
    71    * 
    72    * @param process svn process 
    73    */ 
    74   private void checkProcessResult(Process process, String action) throws Exception { 
    75  
    76     try { 
    77       String errorString = new String(StreamUtils.readBytesFromInputStream(process.getErrorStream())); 
    78       throw new Exception(action + " failed due to the following error:\n" + errorString); 
    79     } catch (IOException e) { 
    80       e.printStackTrace(); 
    81       throw new Exception(action + " failed!", e); 
    82     } 
    83   } 
    84  
    8564  public synchronized Pair<Boolean, String> commit(File dir, String message) throws Exception { 
    8665    message = message.replace('"', ' '); 
    8766    message = message.replace('\\', ' '); 
    8867 
    89     Process svn; 
    90     try { 
    91       svn = ProcessUtil.exec(new String[]{"svn", "--non-interactive", "commit", "-m", message}, dir); 
    92     } catch (Exception e) { 
    93       e.printStackTrace(); 
    94       throw new Exception("SVN update failed!", e); 
    95 //      return new Pair<Boolean, String>(false, "<font color=red><b>Exception: " + e.getMessage() + "</b></font>"); 
    96     } 
    97  
    98     boolean success = true; 
     68    Process svn = ProcessUtil.exec(new String[]{"svn", "--non-interactive", "commit", "-m", message}, dir); 
     69 
     70    boolean success = true; 
    9971 
    10072    StringBuilder builder = new StringBuilder(); 
     
    181153  } 
    182154 
     155  /** 
     156   * Check if the return code of the svn process is OK. 
     157   * 
     158   * @param process svn process 
     159   */ 
     160  private void checkProcessResult(Process process, String action) throws Exception { 
     161    String errorString = new String(StreamUtils.readBytesFromInputStream(process.getErrorStream())); 
     162    if (!errorString.equals("")) { 
     163      throw new Exception(action + " failed due to the following error:\n" + errorString); 
     164    } 
     165  } 
     166 
    183167  public static class UpdateResult { 
    184168    public static final int TYPE_UPDATE = 0;