Exception used when the subclass for a given interface type / resource class pair
        cannot be found.
321442
def subclass_notfound(cls, interface_type_resource_class,
                          resource_name=None):
        

        msg = "Parser for not found (%s)." % interface_type_resource_class

        if resource_name:
            msg = "Could not parse '%s'. %s" % (resource_name, msg)

        return cls(msg)
1311686
public static void throwExceptionIfMethodWasNotFound(Class<?> type, String methodName, Method methodToMock,
                                                         Object... arguments) {
        if (methodToMock == null) {
            String methodNameData = "";
            if (methodName != null) {
                methodNameData = "with name '" + methodName + "' ";
            }
            throw new MethodNotFoundException("No method found " + methodNameData + "with parameter types: [ "
                                                      + getArgumentTypesAsString(arguments) + " ] in class " + getOriginalUnmockedType(type)
                                                                                                                       .getName() + ".");
        }
    }
120170
public static void throwRuntimeException(Throwable t)
    {
        // Unchecked? Can re-throw as is
        throwIfUnchecked(t);
        // Otherwise, let's just change its type:
        throw new RuntimeException("[was "+t.getClass()+"] "+t.getMessage(), t);
    }
1000302
@Override
    public ApiResponse handleApplicationException(ApiFailureResource resource, RuntimeException cause) {
        final FaicliUnifiedFailureType failureType = FaicliUnifiedFailureType.BUSINESS_ERROR;
        final FaicliUnifiedFailureResult result = createFailureResult(failureType, resource, cause);
        return asJson(result).httpStatus(prepareBusinessFailureStatus());
    }
986835
public static void exception(Object o, TraceComponent tc, Throwable t) {
    if(isTracing()) SibTr.exception(o, tc, t);

  }
741532
private void checkForUTOKENNotFoundError(Subject subj) throws ResourceException {

        // A Subject without a UTOKEN genericCredential can
        // legitimately occur in the case where the resource
        // adapter has indicated Thread Identity Support
        // is "ALLOWED, but a valid Container-managed alias
        // was specified. On the other hand, at this ponit, if
        // either of the following two cases exist when there is
        // no UTOKEN genericCredential, then we have an
        // unexpected error and need to throw an exception:
        //
        //   1. The resource adapter REQUIRES that Thread Identity
        //      be used.
        //
        //   2. The Subject has no private credentials at all
        //

        // Check if ThreadIdentitySupport is "REQUIRED"

        if (m_ThreadIdentitySupport == AbstractConnectionFactoryService.THREAD_IDENTITY_REQUIRED) {

            // ThreadIdentitySupport indicates that the use of thread
            // identity is "REQUIRED" by the connector, but the
            // Subject doesn't contain a UTOKEN GenericCredential.
            // This should not ever occur because finalizeSubject()
            // should have created a Subject with a UTOKEN
            // GenericCredential when ThreadidentitySupport is
            // "REQUIRED". Thus, throw an exception to terminate
            // processing right here.
            //

            try {
                IllegalStateException e = new IllegalStateException("ThreadIdentitySecurityHelper.beforeGettingConnection() detected Subject not setup for using thread identity, but the connector requires thread identity be used.");
                Object[] parms = new Object[] { "ThreadIdentitySecurityHelper.beforeGettingConnection()", e };
                Tr.error(tc, "ILLEGAL_STATE_EXCEPTION_J2CA0079", parms);
                throw e;
            } catch (IllegalStateException ise) {
                ResourceException re = new ResourceException("ThreadIdentitySecurityHelper.beforeGettingConnection() detected Subject with illegal state");
                re.initCause(ise);
                throw re;
            }

        } // end if m_ThreadIdentitySupport.equals REQUIRED

        // Check if Subject has at least one a private credential

        Set privateCredentials = subj.getPrivateCredentials();
        Iterator privateIterator = privateCredentials.iterator();

        if (!privateIterator.hasNext()) { // if no private credentials

            // There is not only no UTOKEN generic credential, but
            // also, there are no private credentials at all. This
            // should not happen. If there are no private credentials,
            // the finalizeSubject() processing should have built
            // a UTOKEN generic credential.
            //

            try {
                IllegalStateException e = new IllegalStateException("ThreadIdentitySecurityHelper.beforeGettingConnection() detected Subject with no credentials.");
                Object[] parms = new Object[] { "ThreadIdentitySecurityHelper.beforeGettingConnection()", e };
                Tr.error(tc, "ILLEGAL_STATE_EXCEPTION_J2CA0079", parms);
                throw e;
            } catch (IllegalStateException ise) {
                ResourceException re = new ResourceException("ThreadIdentitySecurityHelper.beforeGettingConnection() detected Subject with illegal state");
                re.initCause(ise);
                throw re;
            }

        } // end if no private credentials
    }
276464
protected void handleAdapterInvocationError(Throwable errorCause)
        throws ActivityException {
        logger.severeException(getAdapterInvocationErrorMessage(), errorCause);
        boolean isErrorRetryable;
        int errorCode;
        if (errorCause instanceof AdapterException) {
            AdapterException adEx = (AdapterException) errorCause;
            isErrorRetryable = adEx.isRetryable();
            if (adEx.getCode() != 0) {
                errorCode = adEx.getCode();
            }
            else {
                errorCode = ServiceException.INTERNAL_ERROR;
            }
        }
        else if (errorCause instanceof ConnectionException) {
            errorCode = ((ConnectionException)errorCause).getCode();
            // if process is invoked sync style, no need to retry due to connection failure
            Process procVO = getProcessDefinition();
            if (procVO.getProcessType().equals(ProcessVisibilityConstant.SERVICE)) {
                super.setReturnCode("ERROR:");
                return;
            }
            isErrorRetryable = true;
        }
        else {
            errorCode = ServiceException.INTERNAL_ERROR;
            isErrorRetryable = false;
        }

        if (isErrorRetryable) {
            super.setReturnCode(ActivityResultCodeConstant.RESULT_RETRY);
        }

        this.handleAdapterFailure(errorCode, errorCause);
    }
1303070
@Override
    public void exceptionCaught(IoSession session, Throwable cause) {
        final IoSessionInputStream in = (IoSessionInputStream) session
                .getAttribute(KEY_IN);

        IOException e = null;
        if (cause instanceof StreamIoException) {
            e = (IOException) cause.getCause();
        } else if (cause instanceof IOException) {
            e = (IOException) cause;
        }

        if (e != null && in != null) {
            in.throwException(e);
        } else {
            LOGGER.warn("Unexpected exception.", cause);
            session.close(true);
        }
    }
1137151
public final void interfaceBody() throws RecognitionException {
		int interfaceBody_StartIndex = input.index();

		try {
			if ( state.backtracking>0 && alreadyParsedRule(input, 20) ) { return; }

			// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:355:5: ( '{' ( interfaceBodyDeclaration )* '}' )
			// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:355:7: '{' ( interfaceBodyDeclaration )* '}'
			{
			match(input,121,FOLLOW_121_in_interfaceBody649); if (state.failed) return;
			// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:355:11: ( interfaceBodyDeclaration )*
			loop32:
			while (true) {
				int alt32=2;
				int LA32_0 = input.LA(1);
				if ( (LA32_0==ENUM||LA32_0==Identifier||(LA32_0 >= 52 && LA32_0 <= 53)||LA32_0==58||LA32_0==63||LA32_0==65||LA32_0==67||(LA32_0 >= 71 && LA32_0 <= 72)||LA32_0==77||LA32_0==83||LA32_0==85||(LA32_0 >= 92 && LA32_0 <= 94)||LA32_0==96||(LA32_0 >= 100 && LA32_0 <= 102)||(LA32_0 >= 105 && LA32_0 <= 107)||LA32_0==110||LA32_0==114||(LA32_0 >= 118 && LA32_0 <= 119)) ) {
					alt32=1;
				}

				switch (alt32) {
				case 1 :
					// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:355:11: interfaceBodyDeclaration
					{
					pushFollow(FOLLOW_interfaceBodyDeclaration_in_interfaceBody651);
					interfaceBodyDeclaration();
					state._fsp--;
					if (state.failed) return;
					}
					break;

				default :
					break loop32;
				}
			}

			match(input,125,FOLLOW_125_in_interfaceBody654); if (state.failed) return;
			}

		}
		catch (RecognitionException re) {
			reportError(re);
			recover(input,re);
		}
		finally {
			// do for sure before leaving
			if ( state.backtracking>0 ) { memoize(input, 20, interfaceBody_StartIndex); }

		}
	}
225104
private static <T> T nullForNotFound(IOException exception) {
    ComputeException serviceException = translate(exception);
    if (serviceException.getCode() == HTTP_NOT_FOUND) {
      return null;
    }
    throw serviceException;
  }
744946
@Override
  void throwInternalError(String message, Throwable cause) {
    String finalMessage = "INTERNAL COMPILER ERROR.\nPlease report this problem.\n\n" + message;

    RuntimeException e = new RuntimeException(finalMessage, cause);
    if (cause != null) {
      e.setStackTrace(cause.getStackTrace());
    }
    throw e;
  }
156724
@SuppressWarnings("all")
    public static Method findMethodOrThrowException(Class<?> type, String methodName, Class<?>... parameterTypes) {
        Method methodToMock = findMethod(type, methodName, parameterTypes);
        throwExceptionIfMethodWasNotFound(type, methodName, methodToMock, (Object[]) parameterTypes);
        return methodToMock;
    }
1369284
@Override
  public void onException(Throwable failureCause) {
    Preconditions.checkNotNull(failureCause, "failureCause");
    Status status = Status.UNAVAILABLE.withCause(failureCause);
    startGoAway(0, ErrorCode.INTERNAL_ERROR, status);
  }
315166
public <E extends Exception> E findWrapped(Class<E> exceptionType) {
		
		if (exceptionType == null) {
			return null;
		}
		
		Throwable cause = getCause();
		
		while (true) {
			
			if (cause == null) {
				return null;
			}
			
			if (exceptionType.isInstance(cause)) {
				
				@SuppressWarnings("unchecked") E matchedCause = (E) cause;
				return matchedCause;
			}
			
			if (cause.getCause() == cause) {
				return null;
			}
			
			if (cause instanceof WrappedRuntimeException) {
				return ((WrappedRuntimeException) cause).findWrapped(exceptionType);
			}
			if (cause instanceof WrappedCheckedException) {
				return ((WrappedCheckedException) cause).findWrapped(exceptionType);
			}
			
			cause = cause.getCause();
		}
	}
180815
public static <T, U, X extends RuntimeException> U convertIfNullThrow(T source, Class<U> targetClass,
            Supplier<X> exceptionSupplier) {
        return BeanConvertStrategy.convertBean(source, targetClass, exceptionSupplier);
    }
672306
@SuppressWarnings("rawtypes")  
  public Class getException(ClassLoader warClassLoader) {
    try {
      return Class.forName(errorParam, true, warClassLoader);
    } catch (Exception e) {
      return null;
    }
  }
1348485
public static void ensureNotError(ObjectMapper mapper, JsonNode resourceNode) {
		if (resourceNode != null && resourceNode.hasNonNull(JSONAPISpecConstants.ERRORS)) {
			try {
				throw new ResourceParseException(ErrorUtils.parseError(mapper, resourceNode, Errors.class));
			} catch (JsonProcessingException e) {
				throw new RuntimeException(e);
			}
		}
	}