Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [albireo-dev] component creation protocol: allow for some hooks

Gordon,

> Most importantly, they'll also be visible in the error log file which is 
> more likely to get analyzed later than stdout. This is true whether or 
> not the error log view is configured.

Which "error log file" are you talking about? Where is it located?

> By letting the exception pass through, it will get handled in a standard 
> and consistent way by the containing application.

I can rethrow it. No problem.

> I don't think asyncExec catches exceptions silently. It does wrap them 
> in a SWTException, though. (And I must admit they use a catch of 
> Throwable :-)).

I just tried it:
  - Added an override of afterComponentCreatedSWTThread() that throws
    an OutOfMemoryError,
  - Verified that I see its stack trace in the console of the Eclipse I use
    for debugging,
  - Disabled the printStackTrace() in our code.
  - Verified that this time nothing is visible in the console,
  - Opened the "Error Log" view and found the exception there.

If an OutOfMemoryError occurs and the GUI of the normal user (who does not
have an "Error Log" view open by default) does not show any sign of this
happening, for me it counts as "silent".

Bruno


Index: src/org/eclipse/albireo/core/ThreadingHandler.java
===================================================================
RCS file: /cvsroot/technology/org.eclipse.albireo/org.eclipse.albireo.core/src/org/eclipse/albireo/core/ThreadingHandler.java,v
retrieving revision 1.2
diff -c -3 -r1.2 ThreadingHandler.java
*** src/org/eclipse/albireo/core/ThreadingHandler.java	23 Jan 2008 20:13:27 -0000	1.2
--- src/org/eclipse/albireo/core/ThreadingHandler.java	23 Jan 2008 20:31:10 -0000
***************
*** 77,84 ****
                      public void run() {
                          try {
                              task.run();
!                         } catch (Throwable e) {
                              e.printStackTrace();
                          }
                      }
                  };
--- 77,88 ----
                      public void run() {
                          try {
                              task.run();
!                         } catch (RuntimeException e) {
                              e.printStackTrace();
+                             throw e;
+                         } catch (Error e) {
+                             e.printStackTrace();
+                             throw e;
                          }
                      }
                  };


Back to the top