Package com.substanceofcode.utils

Examples of com.substanceofcode.utils.CauseException


      }
      return unencodedDeserialize(data);
        } catch(CauseException e) {
      throw e;
        } catch(Exception e) {
      CauseException ce = new CauseException(
          "Internal error while RssItunesItem deserialize ", e);
      //#ifdef DLOGGING
      Logger logger = Logger.getLogger("RssItunesItem");
      logger.severe(ce.getMessage(), e);
      //#endif
            System.err.println(ce.getMessage() + " " + e.toString());
      e.printStackTrace();
      throw ce;
        } catch(OutOfMemoryError e) {
      CauseMemoryException ce = new CauseMemoryException(
          "Out of memory error while RssItunesItem deserialize ", e);
      //#ifdef DLOGGING
      Logger logger = Logger.getLogger("RssItunesItem");
      logger.severe(ce.getMessage(), e);
      //#endif
            System.err.println(ce.getMessage() + " " + e.toString());
      e.printStackTrace();
      throw ce;
    }
     
  }
View Full Code Here


    } catch (CauseMemoryException e) {
      throw e;
    } catch (CauseException e) {
      throw e;
        } catch(Exception e) {
      CauseException ce = new CauseException(
          "Internal error during deserialize", e);
      //#ifdef DLOGGING
      Logger logger = Logger.getLogger("RssItunesFeed");
      logger.severe(ce.getMessage(), e);
      //#endif
            System.err.println(ce.getMessage() + " " + e.toString());
      e.printStackTrace();
      throw ce;
        } catch(OutOfMemoryError e) {
      CauseMemoryException ce = new CauseMemoryException(
          "Out of memory error during deserialize", e);
      //#ifdef DLOGGING
      Logger logger = Logger.getLogger("RssItunesFeed");
      logger.severe(ce.getMessage(), e);
      //#endif
            System.err.println(ce.getMessage() + " " + e.toString());
      e.printStackTrace();
      throw ce;
        } catch(Throwable e) {
      CauseException ce = new CauseException(
          "Internal error during deserialize", e);
      //#ifdef DLOGGING
      Logger logger = Logger.getLogger("RssItunesFeed");
      logger.severe(ce.getMessage(), e);
      //#endif
            System.err.println(ce.getMessage() + " " + e.toString());
      e.printStackTrace();
      throw ce;
        }
  }
View Full Code Here

      EncodingStreamReader esr = encUtl.getEncodingStreamReader();
      StringBuffer inputBuffer;
      try {
        inputBuffer = esr.readFile(Common.LANGUAGE_FILE_LEN);
      } catch (IOException ex) {
        CauseException cex = new CauseException(
            "Error while reading file.", ex);
        throw cex;
      } finally {
        if (is != null) {
          try {
View Full Code Here

//#ifdef DLOGGING
//@      logger.severe("Internal error parse read error ", e);
//#endif
      System.out.println("Internal error parse read error " + e + " " + e.getMessage());
      e.printStackTrace();
      CauseException ce = new CauseException(
          "Internal error parse read error. ", e);
      throw ce;
    }
    if( inputCharacter == -1 ) {
      return END_DOCUMENT;
View Full Code Here

      System.out.println("getTextStream Could not read a char run time." + t +
                     " " + t.getMessage());
      t.printStackTrace();
      throw ce;
    } catch (Throwable t) {
      CauseException ce = new CauseException("Unable to read text. " +
          "Internal error.", t);
//#ifdef DLOGGING
//@      logger.severe(ce.getMessage(), ce);
//#endif
      System.out.println("getTextStream Could not read a char run time." + t +
View Full Code Here

      System.out.println("getAttributeValue error." + t + " " +
                     t.getMessage());
      if (m_acceptErrors) {
        return null;
      } else {
        CauseException ce = new CauseException(
            "Parse attribute read error. Internal error.", t);
        throw ce;
      }
    }
    }
View Full Code Here

    }
    if (m_docEncoding.length() != 0) {
      try {
        String a = new String("a".getBytes(), m_docEncoding);
      } catch (UnsupportedEncodingException e) {
        CauseException ce = new CauseException(
            "UnsupportedEncodingException while trying to " +
            "convert doc encoding: " + m_docEncoding, e);
        if (m_excs == null) {
          m_excs = new Vector();
        }
        m_excs.addElement(ce);
        //#ifdef DLOGGING
//@        logger.severe(ce.getMessage(), e);
        //#endif
        System.out.println(ce.getMessage());
        // If encoding problem, use the main encoding as it is
        // close enough.
        if (m_windows) {
          if (hasWinEncoding) {
            m_docEncoding = winEncoding;
          } else {
            m_docEncoding = "";
          }
        } else if (m_utf) {
          m_docEncoding = "";
        } else {
          if (hasIso8859Encoding) {
            m_docEncoding = isoEncoding;
          } else {
            m_docEncoding = "";
          }
        }
        try {
          String a = new String("a".getBytes(), m_docEncoding);
        } catch (UnsupportedEncodingException e2) {
          CauseException ce2 = new CauseException(
              "Second unsupportedEncodingException while " +
              " trying to convert doc encoding: " +
              m_docEncoding, e2);
          m_excs.addElement(ce2);
          //#ifdef DLOGGING
//@          logger.severe(ce2.getMessage(), e2);
          //#endif
          System.out.println(ce2.getMessage());
          m_docEncoding = "";
        }
      }
    }
    m_encodingStreamReader.setModEncoding(modEncoding);
View Full Code Here

    try {
      try {
        String convStr = new String("a".getBytes(), "Cp1252");
        return "Cp1252";
      } catch (UnsupportedEncodingException e) {
        CauseException ce = new CauseException(
            "initWinEncoding UnsupportedEncodingException " +
            "while trying to convert encoding Cp1252.", e);
        if (m_statExcs == null) {
          m_statExcs = new Vector();
        }
        m_statExcs.addElement(ce);
        //#ifdef DTEST
//@        System.out.println(ce.getMessage());
        //#endif
        //#ifdef DLOGGING
//@        Logger logger = Logger.getLogger("EncodingUtil");
//@        logger.severe(ce.getMessage(), e);
        //#endif
        try {
          String convStr2 = new String("a".getBytes(), "WINDOWS-1252");
          return "WINDOWS-1252";
        } catch (UnsupportedEncodingException e2) {
          CauseException ce2 = new CauseException(
              "initWinEncoding second " +
              "unsupportedEncodingException while " +
              " trying to convert encoding WINDOWS-1252.", e2);
          m_statExcs.addElement(ce2);
          //#ifdef DTEST
View Full Code Here

    try {
      try {
        String convStr = new String("a".getBytes(), "Cp1252");
        return true;
      } catch (UnsupportedEncodingException e) {
        CauseException ce = new CauseException(
            "hasWinEncoding UnsupportedEncodingException " +
            "while trying to convert encoding Cp1252.", e);
        if (m_statExcs == null) {
          m_statExcs = new Vector();
        }
        m_statExcs.addElement(ce);
        //#ifdef DTEST
//@        System.out.println(ce.getMessage());
        //#endif
        //#ifdef DLOGGING
//@        Logger logger = Logger.getLogger("EncodingUtil");
//@        logger.severe(ce.getMessage(), e);
        //#endif
        try {
          String convStr2 = new String("a".getBytes(), "WINDOWS-1252");
          return true;
        } catch (UnsupportedEncodingException e2) {
          CauseException ce2 = new CauseException(
              "initWinEncoding second " +
              "unsupportedEncodingException while " +
              " trying to convert encoding WINDOWS-1252.", e2);
          m_statExcs.addElement(ce2);
          //#ifdef DTEST
View Full Code Here

      EncodingStreamReader esr = encUtl.getEncodingStreamReader();
      StringBuffer inputBuffer;
      try {
        inputBuffer = esr.readFile(Common.LANGUAGE_FILE_LEN);
      } catch (IOException ex) {
        CauseException cex = new CauseException(
            "Error while reading file.", ex);
        throw cex;
      } finally {
        if (is != null) {
          try {
View Full Code Here

TOP

Related Classes of com.substanceofcode.utils.CauseException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.