Java 8 UndeclaredThrowableException - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Java 8 UndeclaredThrowableException class.

This code example shows how to use the following methods:getUndeclaredThrowable
	public void run() { 
		try { 
			this.delegate.run();
		} 
		catch (UndeclaredThrowableException ex) {
			this.errorHandler.handleError(ex.getUndeclaredThrowable());
		} 
		catch (Throwable ex) {
			this.errorHandler.handleError(ex);
		} 
	} 
 
	@Override 
	public String toString() {
		return "DelegatingErrorHandlingRunnable for " + this.delegate;
	} 
 
} 
7
CodeRank
This code example shows how to use the following methods:
         } 
      } 
      if (t instanceof Error) {
         throw (Error) t;
      } 
      throw new UndeclaredThrowableException(t);
   } 
 
   protected SOAPFaultException findSoapFaultException(Throwable ex) {
        if (ex instanceof SOAPFaultException) {
            return (SOAPFaultException)ex;
        } 
        if (ex.getCause() != null) {
            return findSoapFaultException(ex.getCause());
        } 
        return null; 
    } 
 
   /** 
    * Compares two methods if they are identical. 
7
CodeRank
This code example shows how to use the following methods:
		} 
		catch (InvocationTargetException ex) {
			ReflectionUtils.rethrowRuntimeException(ex.getTargetException());
		} 
		catch (IllegalAccessException ex) {
			throw new UndeclaredThrowableException(ex);
		} 
	} 
 
} 
7
CodeRank
This code example shows how to use the following methods:
    if (se.getCause() instanceof RemoteException) {
      return ((RemoteException) se.getCause()).unwrapRemoteException();
    } else if (se.getCause() instanceof IOException) {
      return (IOException)se.getCause();
    } else { 
      throw new UndeclaredThrowableException(se.getCause());
    } 
  } 
} 
6
CodeRank
This code example shows how to use the following methods:getCause, getUndeclaredThrowable
 
    /** 
     * java.lang.reflect.UndeclaredThrowableException#UndeclaredThrowableException(java.lang.Throwable) 
     */ 
    public void test_Constructor_Throwable() throws Exception {
        UndeclaredThrowableException e = new UndeclaredThrowableException(
                throwable);
        assertEquals("Wrong cause returned", throwable, e.getCause());
        assertEquals("Wrong throwable returned", throwable, e
                .getUndeclaredThrowable());
    } 
 
    /** 
     * java.lang.reflect.UndeclaredThrowableException#UndeclaredThrowableException(java.lang.Throwable, java.lang.String) 
     */ 
    public void test_Constructor_Throwable_String() throws Exception {
       UndeclaredThrowableException e = new UndeclaredThrowableException(
                throwable, msg);
        assertEquals("Wrong cause returned", throwable, e.getCause());
        assertEquals("Wrong throwable returned", throwable, e
6
CodeRank
This code example shows how to use the following methods:getUndeclaredThrowable
import org.apache.commons.logging.Log; 
 
public class ProxyExceptionHelper { 
 
  public static void handleException(UndeclaredThrowableException e, Log LOG) throws IOException {
    if (e.getUndeclaredThrowable() instanceof InvocationTargetException) {
      InvocationTargetException ex = ((InvocationTargetException) e.getUndeclaredThrowable());
      if (ex.getTargetException() instanceof IOException) {
        throw (IOException) ex.getTargetException();
      } else { 
        LOG.fatal("Unexpected exception is occurred", ex.getTargetException());
        throw new IOException("Unexpected exception is occurred : " + e, e);
      } 
    } else { 
      LOG.fatal("Unexpected exception is occurred", e);
      throw new IOException("Unexpected exception is occurred : " + e, e);
    } 
     
  } 
 
6
CodeRank
This code example shows how to use the following methods:getUndeclaredThrowable
	public void run() { 
		try { 
			this.delegate.run();
		} 
		catch (UndeclaredThrowableException ex) {
			this.errorHandler.handleError(ex.getUndeclaredThrowable());
		} 
		catch (Throwable ex) {
			this.errorHandler.handleError(ex);
		} 
	} 
 
	@Override 
	public String toString() {
		return "DelegatingErrorHandlingRunnable for " + this.delegate;
	} 
 
} 
6
CodeRank
This code example shows how to use the following methods:getUndeclaredThrowable
				Throwable cause = targetEx.getCause();
				throw convertBurlapAccessException(cause != null ? cause : targetEx);
			} 
			else if (targetEx instanceof UndeclaredThrowableException) {
				UndeclaredThrowableException utex = (UndeclaredThrowableException) targetEx;
				throw convertBurlapAccessException(utex.getUndeclaredThrowable());
			} 
			else { 
				throw targetEx;
			} 
		} 
		catch (Throwable ex) {
			throw new RemoteProxyFailureException(
					"Failed to invoke Burlap proxy for remote service [" + getServiceUrl() + "]", ex);
		} 
		finally { 
			resetThreadContextClassLoader(originalClassLoader);
		} 
	} 
 
6
CodeRank
This code example shows how to use the following methods:
				throw err;
			} 
			catch (Exception ex) {
				// Transactional code threw unexpected exception -> rollback 
				rollbackOnException(status, ex);
				throw new UndeclaredThrowableException(ex, "TransactionCallback threw undeclared checked exception");
			} 
			this.transactionManager.commit(status);
			return result;
		} 
	} 
 
	/** 
	 * Perform a rollback, handling rollback exceptions properly. 
	 * @param status object representing the transaction 
	 * @param ex the thrown application exception or error 
	 * @throws TransactionException in case of a rollback error 
	 */ 
	private void rollbackOnException(TransactionStatus status, Throwable ex) throws TransactionException {
		logger.debug("Initiating transaction rollback on application exception", ex);
6
CodeRank
This code example shows how to use the following methods:getMessage, getCause
    /** 
     * @tests {@link java.lang.reflect.UndeclaredThrowableException#UndeclaredThrowableException(java.lang.Throwable, java.lang.String)} 
     * 
     */ 
    public void test_UndeclaredThrowableException_LThrowable_LString() { 
        UndeclaredThrowableException e = new UndeclaredThrowableException(null,
                "SomeMsg"); 
        assertNotNull(e);
        assertNull(e.getCause());
        assertEquals("Wrong message", "SomeMsg", e.getMessage());
    } 
 
    /** 
     * @tests {@link java.lang.reflect.UndeclaredThrowableException#getUndeclaredThrowable()} 
     */ 
    public void test_getUndeclaredThrowable() { 
        UndeclaredThrowableException e = new UndeclaredThrowableException(null);
        assertNotNull(e);
        assertNull(e.getUndeclaredThrowable());
    } 
6
CodeRank
See Code Examples for Java 8 UndeclaredThrowableException Methods: