'Exception Utilities'에 해당되는 글 1건

  1. 2010.02.19 Exception Utilities
반응형
import org.apache.commons.lang.exception.ExceptionUtils;
import org.apache.commons.lang.exception.NestableException;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;

public class ExceptionUtilsV1 {
  public static void main(String args[]) {
    try {
      loadFile();
    } catch(Exception e) {
      e.printStackTrace();
    }
  }

  public static void loadFile() throws Exception {
    try {
      FileInputStream fis =
       new FileInputStream(new File("nosuchfile"));
    } catch (FileNotFoundException fe) {
      throw new NestableException(fe);
    }
  }
}
Posted by 1010