1 30 31 package com.caucho.eswrap.java.lang; 32 33 import com.caucho.es.ESException; 34 import com.caucho.vfs.WriteStream; 35 36 import java.io.OutputStream ; 37 import java.io.PrintStream ; 38 import java.io.PrintWriter ; 39 40 public class ExceptionEcmaWrap { 41 public static void printStackTrace(Exception e, Object o) 42 { 43 if (o instanceof PrintStream ) 44 e.printStackTrace((PrintStream ) o); 45 else if (o instanceof PrintWriter ) 46 e.printStackTrace((PrintWriter ) o); 47 else if (o instanceof WriteStream) 48 e.printStackTrace(((WriteStream) o).getPrintWriter()); 49 else 50 e.printStackTrace(); 51 } 52 53 public static void printESStackTrace(Exception e, Object o) 54 { 55 if (o instanceof OutputStream ) 56 ESException.staticPrintESTrace(e, (OutputStream ) o); 57 else if (o instanceof PrintWriter ) 58 ESException.staticPrintESTrace(e, (PrintWriter ) o); 59 else 60 printStackTrace(e, o); 61 } 62 } 63 64 | Popular Tags |