Package com.substanceofcode.utils

Examples of com.substanceofcode.utils.CauseException


  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

      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

        }
      }
         
      return value;
    } catch (Throwable t) {
      CauseException ce = new CauseException(
          "Parse attribute read error. Internal error.", t);
//#ifdef DLOGGING
//@      logger.severe(ce.getMessage(), ce);
//#endif
      System.out.println(ce.getMessage() + " " + t + " " + t.getMessage());
      if (m_acceptErrors) {
        return null;
      } else {
        throw ce;
      }
View Full Code Here

      //#endif
      if ((url != null) && url.startsWith("file://")) {
        System.err.println("Cannot process file.");
      }

            throw new CauseException("Error while parsing RSS data:  " +
                    url, e);
        } catch(ConnectionNotFoundException e) {
      //#ifdef DLOGGING
//@      logger.severe("handleOpen connection error with " + url, e);
      //#endif
      if ((url != null) && url.startsWith("file://")) {
        System.err.println("Cannot process file.");
      }
            throw new CauseException("Bad URL/File or protocol error while " +
                   "opening: " + url, e);
    //#ifdef DMIDP20
        } catch(CertificateException e) {
      //#ifdef DLOGGING
//@      logger.severe("handleOpen https security error with " + url, e);
      //#endif
      if ((url != null) && url.startsWith("file://")) {
        System.err.println("Cannot process file.");
      }
            throw new CauseException("Bad URL/File or protocol error or " +
          "certifacate error while opening: " + url, e);
    //#endif
        } catch(IOException e) {
      throw e;
        } catch(SecurityException e) {
      //#ifdef DLOGGING
//@      logger.severe("handleOpen security error with " + url, e);
      //#endif
      if ((url != null) && url.startsWith("file://")) {
        System.err.println("Cannot process file.");
      }
            throw new CauseException("Security error while oening " +
                   ": " + url, e);
        } catch(Exception e) {
      //#ifdef DLOGGING
//@      logger.severe("handleOpen internal error with " + url, e);
      //#endif
      if ((url != null) && (url.startsWith("file://"))) {
        System.err.println("Cannot process file.");
      }
            throw new CauseException("Internal error while parsing " +
                   ": " + url, e);
        } catch(Throwable t) {
      //#ifdef DLOGGING
//@      logger.severe("handleOpen internal error with " + url, t);
      //#endif
      t.printStackTrace();
            throw new CauseException("Internal error while parsing RSS data " +
                ":l" + url, t);
        }
    }
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

                      //#endif
                      );
        } catch (CauseException ex) {
      throw ex;
    } catch (Throwable t) {
      CauseException cex = new CauseException(
          "Error while parsing HTML auto link feed " + m_url, t);
//#ifdef DLOGGING
//@      logger.severe(cex.getMessage(), cex);
//#endif
      System.out.println(cex.getMessage() + " " + t + " " + t.getMessage());
      throw cex;
    }
  }
View Full Code Here

      CauseMemoryException cex = new CauseMemoryException(
          "Out of memory error while parsing HTML auto link feed " +
          url, ex);
      throw cex;
        } catch (Exception ex) {
      CauseException cex = new CauseException(
          "Error while parsing HTML auto link feed " + url, ex);
//#ifdef DLOGGING
//@      logger.severe(cex.getMessage(), cex);
//#endif
      System.err.println(cex.getMessage() + " " + ex + " " + ex.getMessage());
      ex.printStackTrace();
      throw cex;
        } catch (Throwable t) {
      CauseException cex = new CauseException(
          "Error while parsing HTML auto link feed " + url, t);
//#ifdef DLOGGING
//@      logger.severe(cex.getMessage(), cex);
//#endif
      System.err.println(cex.getMessage() + " " + t + " " + t.getMessage());
      t.printStackTrace();
      throw cex;
        }
       
        /** Create array */
 
View Full Code Here

    recordExcForm(ResourceProviderME.get(key), e);
  }

  /* Record the exception in the loading form, log it and give std error. */
  final public void recordExcForm(final String causeMsg, final Throwable e) {
    final CauseException ce = new CauseException(causeMsg, e);
    m_loadForm.addExc(ce);
    //#ifdef DLOGGING
//@    logger.severe(ce.getMessage(), e);
    //#endif
    /** Error while parsing RSS feed */
    System.out.println(e.getClass().getName() + " " + ce.getMessage());
    e.printStackTrace();
    m_loadForm.appendMsg(ce.getMessage());
    setCurrent( m_loadForm );
  }
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.