Examples of initCause()


Examples of java.net.ConnectException.initCause()

       

        if (!channelFuture.isDone() || !channelFuture.isSuccess()) {
            ConnectException cause = new ConnectException("Cannot connect to " + configuration.getAddress());
            if (channelFuture.getCause() != null) {
                cause.initCause(channelFuture.getCause());
            }
            throw cause;
        }
        Channel answer = channelFuture.getChannel();
        // to keep track of all channels in use
View Full Code Here

Examples of java.net.MalformedURLException.initCause()

       * '//:<port>' forms will result in a URI syntax exception
       * Convert the authority to a localhost:<port> form
       */
      MalformedURLException mue = new MalformedURLException(
    "invalid URL String: " + str);
      mue.initCause(ex);
      int indexSchemeEnd = str.indexOf(':');
      int indexAuthorityBegin = str.indexOf("//:");
      if (indexAuthorityBegin < 0) {
    throw mue;
      }
View Full Code Here

Examples of java.net.SocketException.initCause()

       * from other exceptions if this is not a subclass of IOException.
       */
      if (e.getClass().equals(IOException.class)) {
        // "se" could be a new class in stead of SocketException.
        IOException se = new SocketException("Original Exception : " + e);
        se.initCause(e);
        /* Cange the stacktrace so that original trace is not truncated
         * when printed.*/
        se.setStackTrace(e.getStackTrace());
        throw se;
      }
View Full Code Here

Examples of java.net.SocketTimeoutException.initCause()

            NettyResponseFuture<?, ?> nettyResponseFuture = (NettyResponseFuture<?, ?>) context.getAttachment();

            if (nettyResponseFuture != null) {
                if (cause instanceof ReadTimeoutException) {
                    SocketTimeoutException socketTimeoutException = new SocketTimeoutException("Read timeout");
                    socketTimeoutException.initCause(cause);
                    cause = socketTimeoutException;
                }
                if (cause == null) {
                    cause = new UnknownRequestException();
                }
View Full Code Here

Examples of java.net.URISyntaxException.initCause()

        }
        catch (ArrayIndexOutOfBoundsException e)
        {
                _error = "Invalid URL format [current_state = " + prevState + ", details parsed so far " + _bindingURL + " ] error at (" + _index + ")";
                URISyntaxException ex = new URISyntaxException(markErrorLocation(),"Error occured while parsing URL",_index);
                ex.initCause(e);
                throw ex;
        }
    }

    enum BindingURLParserState
View Full Code Here

Examples of java.net.UnknownHostException.initCause()

            }
            return jdkSuppliedAddress;
        } catch (Exception e) {
            UnknownHostException unknownHostException = new UnknownHostException(
                    "Failed to determine LAN address");
            unknownHostException.initCause(e);
            throw unknownHostException;
        }
    }

    /**
 
View Full Code Here

Examples of java.net.UnknownServiceException.initCause()

      @SuppressWarnings("unchecked")
      List<FileItem> fileItems = upload.parseRequest(servletRequest);
      return convertToFormData(fileItems);
    } catch (FileUploadException e) {
      UnknownServiceException use = new UnknownServiceException("File upload error.");
      use.initCause(e);
      throw use;
    }
  }

  private Collection<FormDataItem> convertToFormData(List<FileItem> fileItems) {
View Full Code Here

Examples of java.nio.BufferUnderflowException.initCause()

            //
            // Morph an IndexOutOfBoundsException to a BufferUnderflowException
            // for consistency.
            //
            final BufferUnderflowException bue = new BufferUnderflowException();
            bue.initCause( e );
            throw bue;
        }
    }

    /**
 
View Full Code Here

Examples of java.nio.channels.ClosedChannelException.initCause()

        {
            // most likely the sender did close the connection or something other (firewall?) does interfere the
            // communication
            ClosedChannelException che = new ClosedChannelException();
            che.setStackTrace( e.getStackTrace() );
            che.initCause( e.getCause() );
            throw che;
        }

        if ( buffer.hasRemaining() )
        {
View Full Code Here

Examples of java.nio.channels.NonReadableChannelException.initCause()

     */
    private NonReadableChannelException fillException( IOException e )
    {
        NonReadableChannelException ne = new NonReadableChannelException();
        ne.setStackTrace( e.getStackTrace() );
        ne.initCause( e.getCause() );
        return ne;
    }
}
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.