Examples of ExceptionWrapper


Examples of com.google.gwt.junit.client.impl.ExceptionWrapper

    GWT.setUncaughtExceptionHandler(null);
    uncaughtHandler = null;

    JUnitResult myResult = __getOrCreateTestResult();
    if (ex != null) {
      ExceptionWrapper ew = new ExceptionWrapper(ex);
      if (checkPoints != null) {
        for (int i = 0, c = checkPoints.size(); i < c; ++i) {
          ew.message += "\n" + checkPoints.get(i);
        }
      }
View Full Code Here

Examples of com.google.gwt.junit.client.impl.ExceptionWrapper

  public TestBlock reportResultsAndGetTestBlock(
      HashMap<TestInfo, JUnitResult> results, int testBlock,
      ClientInfo clientInfo) throws TimeoutException {
    for (JUnitResult result : results.values()) {
      initResult(getThreadLocalRequest(), result);
      ExceptionWrapper ew = result.getExceptionWrapper();
      result.setException(deserialize(ew));
    }
    JUnitMessageQueue host = getHost();
    ClientInfoExt clientInfoExt = createClientInfo(clientInfo,
        getThreadLocalRequest());
View Full Code Here

Examples of freenet.support.ExceptionWrapper

    else if(logMINOR)
      Logger.minor(this, "Container size (possibly compressed): "+archiveSize+" for "+data);

    InputStream is = null;
    try {
      final ExceptionWrapper wrapper;
      if((ctype == null) || (ARCHIVE_TYPE.ZIP == archiveType)) {
        if(logMINOR) Logger.minor(this, "No compression");
        is = data.getInputStream();
        wrapper = null;
      } else if(ctype == COMPRESSOR_TYPE.BZIP2) {
        if(logMINOR) Logger.minor(this, "dealing with BZIP2");
        is = new BZip2CompressorInputStream(data.getInputStream());
        wrapper = null;
      } else if(ctype == COMPRESSOR_TYPE.GZIP) {
        if(logMINOR) Logger.minor(this, "dealing with GZIP");
        is = new GZIPInputStream(data.getInputStream());
        wrapper = null;
      } else if(ctype == COMPRESSOR_TYPE.LZMA_NEW) {
        // LZMA internally uses pipe streams, so we may as well do it here.
        // In fact we need to for LZMA_NEW, because of the properties bytes.
        PipedInputStream pis = new PipedInputStream();
        PipedOutputStream pos = new PipedOutputStream();
        pis.connect(pos);
        final OutputStream os = new BufferedOutputStream(pos);
        wrapper = new ExceptionWrapper();
        context.mainExecutor.execute(new Runnable() {

          @Override
          public void run() {
            InputStream is = null;
            try {
              Compressor.COMPRESSOR_TYPE.LZMA_NEW.decompress(is = data.getInputStream(), os, data.size(), expectedSize);
            } catch (CompressionOutputSizeException e) {
              Logger.error(this, "Failed to decompress archive: "+e, e);
              wrapper.set(e);
            } catch (IOException e) {
              Logger.error(this, "Failed to decompress archive: "+e, e);
              wrapper.set(e);
            } finally {
              try {
                os.close();
              } catch (IOException e) {
                Logger.error(this, "Failed to close PipedOutputStream: "+e, e);
              }
              Closer.close(is);
            }
          }
         
        });
        is = pis;
      } else if(ctype == COMPRESSOR_TYPE.LZMA) {
        if(logMINOR) Logger.minor(this, "dealing with LZMA");
        is = new LzmaInputStream(data.getInputStream());
        wrapper = null;
      } else {
        wrapper = null;
      }

      if(ARCHIVE_TYPE.ZIP == archiveType)
        handleZIPArchive(ctx, key, is, element, callback, gotElement, throwAtExit, context);
      else if(ARCHIVE_TYPE.TAR == archiveType)
        handleTARArchive(ctx, key, is, element, callback, gotElement, throwAtExit, context);
    else
        throw new ArchiveFailureException("Unknown or unsupported archive algorithm " + archiveType);
      if(wrapper != null) {
        Exception e = wrapper.get();
        if(e != null) throw new ArchiveFailureException("An exception occured decompressing: "+e.getMessage(), e);
      }
    } catch (IOException ioe) {
      throw new ArchiveFailureException("An IOE occured: "+ioe.getMessage(), ioe);
    }finally {
View Full Code Here

Examples of org.apache.drill.exec.proto.UserBitShared.ExceptionWrapper


  public static String getErrorMessage(final DrillPBError error, final boolean verbose) {

    String finalMessage = null;
    ExceptionWrapper ex = error.getException();
    StringBuilder sb = new StringBuilder();



    sb //
      .append("[ ") //
      .append(error.getErrorId()) //
      .append(" on ")
      .append(error.getEndpoint().getAddress())
      .append(":").append(error.getEndpoint().getUserPort())
      .append(" ]\n");

    boolean cause = false;
    while(ex != null){

      if(ex.hasMessage()){
        finalMessage = ex.getMessage();
      }

      if(verbose){
        sb.append("  ");

        if(cause){
          sb.append("Caused By ");
        }

        sb.append("(");
        sb.append(ex.getExceptionClass());
        sb.append(") ");
        sb.append(ex.getMessage());
        sb.append("\n");
        for(int i = 0; i < ex.getStackTraceCount(); i++){
          StackTraceElementWrapper st = ex.getStackTrace(i);
          sb.append("    ");
          sb.append(st.getClassName());
          sb.append('.');
          sb.append(st.getMethodName());
          sb.append("():");
          sb.append(st.getLineNumber());
          sb.append("\n");
        }
        cause = true;
      }

      ex = ex.hasCause() ? ex.getCause() : null;


    }

    StringBuilder msg = new StringBuilder();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.