JEphem Informatic Trail tig source code Exceptions.java
//*********************************************************************************
// class tig.Exceptions
// Software released under the General Public License (version 2 or later), available at
// http://www.gnu.org/copyleft/gpl.html
//*********************************************************************************
package tig;

import tig.GeneralConstants;
/**********************************************************************************
Provides Exception utilities.

@author Thierry Graff
@history apr 25 2002 : Creation
**********************************************************************************/
public abstract class Exceptions implements GeneralConstants{
  /** Useless, as abstract class*/
  public Exceptions(){}

  /** Useless, as abstract class*/
  public static void printShortTrace(Exception e){
    int stackLen = 5;
    try{
      System.out.println(e.toString());
      StackTraceElement[] st = e.getStackTrace();
      StackTraceElement curSte;
      for (int i = 0; i < Math.min(st.length, stackLen) ; i++){ // does compiler optimize ? (min() called once)
        curSte = st[i];
        System.out.println(st[i].toString());
      }

    }
    catch(Exception ex) {
    }
  } // end printShortTrace


}//end class Exceptions