Changeset 3087 for trunk


Ignore:
Timestamp:
08/14/07 12:13:07 (13 years ago)
Author:
curtis
Message:

More verbose error reporting.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/loci/plugins/MacroFunctions.java

    r3086 r3087  
    1212import java.lang.reflect.InvocationTargetException; 
    1313import java.lang.reflect.Method; 
     14import java.io.ByteArrayOutputStream; 
     15import java.io.PrintStream; 
    1416 
    1517public class MacroFunctions implements PlugIn, MacroExtension { 
     
    4547      getClass().getMethod(name, c).invoke(this, args); 
    4648    } 
    47     catch (NoSuchMethodException exc) { exc.printStackTrace(); } 
    48     catch (IllegalAccessException exc) { exc.printStackTrace(); } 
    49     catch (InvocationTargetException exc) { exc.printStackTrace(); } 
     49    catch (NoSuchMethodException exc) { 
     50      ByteArrayOutputStream out = new ByteArrayOutputStream(); 
     51      exc.printStackTrace(new PrintStream(out)); 
     52      IJ.error(new String(out.toByteArray())); 
     53    } 
     54    catch (IllegalAccessException exc) { 
     55      ByteArrayOutputStream out = new ByteArrayOutputStream(); 
     56      exc.printStackTrace(new PrintStream(out)); 
     57      IJ.error(new String(out.toByteArray())); 
     58    } 
     59    catch (InvocationTargetException exc) { 
     60      ByteArrayOutputStream out = new ByteArrayOutputStream(); 
     61      exc.printStackTrace(new PrintStream(out)); 
     62      IJ.error(new String(out.toByteArray())); 
     63    } 
    5064    return null; 
    5165  } 
Note: See TracChangeset for help on using the changeset viewer.