Digg StumbleUpon LinkedIn YouTube Flickr Facebook Twitter RSS Reset

Une collection de méthodes utilitaires pour manipuler les exceptions


{filelink=4385}

import java.io.*;
 
public final class StringDansException {
 
  public static String obtenirLeStringDeStackTrace(Throwable t) {
 
    if (t != null) {
      StringWriter sw = new StringWriter();
      PrintWriter writer = new PrintWriter(sw);
      t.printStackTrace(writer);
      return sw.getBuffer().toString();
    } else {
      return "";
    }
  }
 
}