01: package com.knowgate.debug;
02:
03: import java.io.IOException;
04: import java.io.PrintWriter;
05: import java.io.FileOutputStream;
06:
07: /**
08: * ErrorHandler.java
09: * Created: Tue Feb 2 12:24:40 1999
10: * @author Sebastian Schaffert
11: * @version $Revision: 1.2 $
12: */
13: public class ErrorHandler {
14:
15: public ErrorHandler(Throwable ex) {
16: PrintWriter oDebugWriter = null;
17: FileOutputStream oDebugStrm = null;
18:
19: try {
20: if (System.getProperty("os.name").startsWith("Windows"))
21: oDebugStrm = new FileOutputStream("C:\\javatrc.txt",
22: true);
23: else
24: oDebugStrm = new FileOutputStream("/tmp/javatrc.txt",
25: true);
26:
27: oDebugWriter = new PrintWriter(oDebugStrm);
28:
29: ex.printStackTrace(oDebugWriter);
30:
31: if (null != oDebugWriter)
32: oDebugWriter.close();
33: oDebugWriter = null;
34: if (null != oDebugStrm)
35: oDebugStrm.close();
36: oDebugStrm = null;
37:
38: } catch (IOException ioe) {
39: }
40: }
41:
42: } // ErrorHandler
|