Package com.substanceofcode.utils

Examples of com.substanceofcode.utils.CauseException


    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
          System.out.println(ce2.getMessage());
          //#endif
          //#ifdef DLOGGING
          logger.severe(ce2.getMessage(), e2);
          //#endif
        }
      }
    } catch (Throwable t) {
      //#ifdef DLOGGING
View Full Code Here


        try {
      // Read all data to buffer.  Use 100 char increments to save on
      // memory.
      inputBuffer = esr.readFile(100);
        } catch (IOException ex) {
      CauseException cex = new CauseException(
          "Error while parsing line by feed " + m_url, ex);
      throw cex;
        }
        String text;
    if (esr.isUtfDoc()) {
View Full Code Here

      } else {
        m_desc = nodes[startIndex + DESC];
      }
         
        } catch(Exception e) {
      CauseException ce = new CauseException(
          "Internal error while RssItem init ", e);
      //#ifdef DLOGGING
      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 RssItem init ", e);
      //#ifdef DLOGGING
      logger.severe(ce.getMessage(), e);
      //#endif
            System.err.println(ce.getMessage() + " " + e.toString());
      e.printStackTrace();
      throw ce;
        }
    }
View Full Code Here

      }
      return unencodedDeserialize(data);
        } catch(CauseException e) {
      throw e;
        } catch(Exception e) {
      CauseException ce = new CauseException(
          "Internal error while RssItem deserialize ", e);
      //#ifdef DLOGGING
      Logger logger = Logger.getLogger("RssItem");
      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 RssItem deserialize ", e);
      //#ifdef DLOGGING
      Logger logger = Logger.getLogger("RssItem");
      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 initialize of RssItunesFeed", e);
      //#ifdef DLOGGING
      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 initialize of RssItunesFeed", e);
      //#ifdef DLOGGING
      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 initialize of RssItunesFeed", e);
      //#ifdef DLOGGING
      logger.severe(ce.getMessage(), e);
      //#endif
            System.err.println(ce.getMessage() + " " + e.toString());
      e.printStackTrace();
      throw ce;
        }
    }
View Full Code Here

  throws CauseRecStoreException, CauseException {
    if (region != m_region) {
      try {
        load(region);
      } catch (IOException e) {
        CauseException ce = new CauseException(
            "IOException while loading region=" + region);
        //#ifdef DLOGGING
        logger.severe(ce.getMessage(), e);
        //#endif
        /** Error while executing constructor */
        System.out.println(ce.getMessage() + e.getMessage());
        e.printStackTrace();
        throw ce;
      } catch (CauseRecStoreException e) {
        throw e;
      } catch (CauseException e) {
        throw e;
      } catch (Exception e) {
        CauseException ce = new CauseException(
            "Internal error during load name,region=" + region);
        //#ifdef DLOGGING
        logger.severe(ce.getMessage(), e);
        //#endif
        System.out.println(ce.getMessage() + e.getMessage());
        e.printStackTrace();
        throw ce;
      }
    }
  }
View Full Code Here

        logger.severe("load ", e);
        //#endif
        /** Error while executing constructor */
        System.out.println("load " + e.getMessage());
        e.printStackTrace();
        throw new CauseException("Internal error while loading region=" +
            region, e);
      } catch (OutOfMemoryError e) {
        m_properties.clear();
        System.gc();
        //#ifdef DLOGGING
        logger.severe("load OutOfMemoryError ", e);
        //#endif
        /** Error while executing constructor */
        System.out.println("load OutOfMemoryError " + e.getMessage());
        e.printStackTrace();
        throw new CauseMemoryException("Out of memory while loading " +
            "region=" + region, e);
      } catch (Throwable e) {
        //#ifdef DLOGGING
        logger.severe("load throwable ", e);
        //#endif
        /** Error while executing constructor */
        System.out.println("load throwable " + e.getMessage());
        e.printStackTrace();
        throw new CauseException("Internal error while loading " +
            "region=" + region, e);
      } finally {
        if( din != null ) {
          try { din.close(); } catch( Exception e ){}
        }
View Full Code Here

        logger.severe("catch ", e);
        //#endif
        /** Error while executing constructor */
        System.out.println("catch " + e.getMessage());
        e.printStackTrace();
        throw new CauseException("Internal error during save.", e);
      } catch (OutOfMemoryError e) {
        m_properties.clear();
        System.gc();
        //#ifdef DLOGGING
        logger.severe("catch OutOfMemoryError ", e);
        //#endif
        /** Error while executing constructor */
        System.out.println("catch OutOfMemoryError " + e.getMessage());
        e.printStackTrace();
        throw new CauseMemoryException("Out of memory while save.", e);
      } catch (Throwable e) {
        CauseException ce = new CauseException("Internal error while " +
            "processing save.", e);
        //#ifdef DLOGGING
        logger.severe(ce.getMessage(), ce);
        //#endif
        /** Error while executing constructor */
        System.out.println(ce.getMessage() + e.getMessage());
        e.printStackTrace();
        throw ce;
      } finally {
        try { dout.close(); } catch( Exception e ){}
       
View Full Code Here

    } catch (CauseMemoryException e) {
      throw e;
    } catch (CauseException e) {
      throw e;
        } catch(Exception e) {
      CauseException ce = new CauseException(
          "Internal error during initialize of RssFeed", e);
      //#ifdef DLOGGING
      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  initialize of RssFeed", e);
      //#ifdef DLOGGING
      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 initialize of RssFeed", e);
      //#ifdef DLOGGING
      logger.severe(ce.getMessage(), e);
      //#endif
            System.err.println(ce.getMessage() + " " + e.toString());
      e.printStackTrace();
      throw ce;
        }
      
    }
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(), t);
//#endif
      System.out.println(ce.getMessage() + " " + t +
                     " " + t.getMessage());
      t.printStackTrace();
      if (m_acceptErrors) {
        return null;
      } else {
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.