Back to index

apport  2.3
Public Member Functions | Static Public Member Functions
com.ubuntu.apport.ApportUncaughtExceptionHandler Class Reference

List of all members.

Public Member Functions

void uncaughtException (Thread t, Throwable e)
HashMap getProblemReport (Thread t, Throwable e)
void writeProblemReport (OutputStream os, HashMap pr) throws IOException

Static Public Member Functions

static String mainClassUrl (Throwable e)
static void install ()

Detailed Description

Definition at line 19 of file

Member Function Documentation

HashMap com.ubuntu.apport.ApportUncaughtExceptionHandler.getProblemReport ( Thread  t,
Throwable  e 
) [inline]

Definition at line 60 of file

              HashMap problemReport = new HashMap();
              StringWriter sw = new StringWriter();
              PrintWriter pw = new PrintWriter(sw);
              problemReport.put("StackTrace", sw.toString());

              problemReport.put("MainClassUrl", mainClassUrl(e));

              return problemReport;

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 105 of file

              Thread.setDefaultUncaughtExceptionHandler(new ApportUncaughtExceptionHandler());
static String com.ubuntu.apport.ApportUncaughtExceptionHandler.mainClassUrl ( Throwable  e) [inline, static]

Definition at line 88 of file

              StackTraceElement[] stacktrace = e.getStackTrace();
              String className = stacktrace[stacktrace.length-1].getClassName();

              if (!className.startsWith("/")) {
                     className = "/" + className;
              className = className.replace('.', '/');
              className = className + ".class";

     classUrl =
                     new ApportUncaughtExceptionHandler().getClass().getResource(className);

              return classUrl.toString();

Here is the caller graph for this function:

void com.ubuntu.apport.ApportUncaughtExceptionHandler.uncaughtException ( Thread  t,
Throwable  e 
) [inline]

Definition at line 24 of file

              if (e instanceof ThreadDeath)

              HashMap problemReport = getProblemReport(t, e);
              //System.out.println("got problem report");

              try {
                     String handler_path = System.getenv("APPORT_JAVA_EXCEPTION_HANDLER");
                     if (handler_path == null)
                         handler_path = "/usr/share/apport/java_uncaught_exception";
                     Process p = new ProcessBuilder(handler_path).start();
                     //System.out.println("started process");

                     OutputStream os = p.getOutputStream();
                     writeProblemReport(os, problemReport);
                     //System.out.println("wrote problem report");


                     try {
                     } catch (InterruptedException ignore) {
                            // ignored

              } catch ( ioe) {
                  System.out.println("could not call java_uncaught_exception");

        System.err.print("Exception in thread \""
                         + t.getName() + "\" ");

Here is the call graph for this function:

void com.ubuntu.apport.ApportUncaughtExceptionHandler.writeProblemReport ( OutputStream  os,
HashMap  pr 
) throws IOException [inline]

Definition at line 73 of file


              StringWriter sw = new StringWriter();
              for(Object o : pr.keySet()) {
                     String key = (String)o;
                     String value = (String)pr.get(o);

Here is the caller graph for this function:

The documentation for this class was generated from the following file: