--- CONVERT THROWABLE TO RESPONSE MESSAGE ---
978725
public static final FastBuildTree throwableToTree(String id, String nodeID, Throwable error) {
		FastBuildTree msg = new FastBuildTree(7);

		msg.putUnsafe("id", id);
		msg.putUnsafe("ver", PROTOCOL_VERSION);
		msg.putUnsafe("sender", nodeID);
		msg.putUnsafe("success", false);
		if (error != null) {

			// Convert to Throwable to MoleculerError
			MoleculerError moleculerError;
			if (error instanceof CompletionException) {
				error = error.getCause();
			}
			if (error instanceof MoleculerError) {
				moleculerError = (MoleculerError) error;
			} else {

				// Unknown (DB? Heap?) issue, maybe its an retryable error
				String message = String.valueOf(error.getMessage());
				message = message.replace('\r', ' ').replace('\n', ' ').trim();
				moleculerError = new MoleculerError(message, error, "MoleculerError", nodeID, false, 500,
						"UNKNOWN_ERROR");
			}

			// Convert MoleculerError to JSON
			FastBuildTree errorMap = new FastBuildTree(8);
			msg.putUnsafe("error", errorMap);
			moleculerError.toTree(errorMap);
		}
		return msg;
	}
966262
public void doWithMessage(WebServiceMessage responseMessage) throws IOException, TransformerException {
        // convert and set response for later access via getResponse():
        response = endpointConfiguration.getMessageConverter().convertInbound(responseMessage, endpointConfiguration, context);
    }
557855
protected Object readResponse(Type returnType, JsonNode jsonObject) throws Throwable {
		return readResponse(returnType, jsonObject, null);
	}
860619
private static String getUsefulMessage(Throwable throwable) {
        while(isBoring(throwable)) {
            throwable = throwable.getCause();
        }

        String message = throwable.getMessage();
        if (message == null) {
            message = throwable.getClass().getName();
        }
        return message;
    }
1298124
@Override
	public void handleReturn(
			int replyCode,
			String replyText,
			String exchange,
			String routingKey,
			BasicProperties properties,
			byte[] body )
	throws IOException {

		String messageType = "undetermined";
		try {
			Message msg = SerializationUtils.deserializeObject( body );
			messageType = msg.getClass().getName();

		} catch( Exception e ) {
			this.logger.severe( "Failed to deserialize a message object." );
			Utils.logException( this.logger, e );
		}

		if( this.logger.isLoggable( Level.WARNING )) {
			final StringBuilder sb = new StringBuilder();
			sb.append("A message sent by a RabbitMQ client was not received by any queue.\n");
			sb.append("Message type: " + messageType + '\n');
			sb.append("Routing key: " + routingKey + '\n');
			sb.append("Reason: " + replyText);
			this.logger.warning( sb.toString());
		}
	}
765232
public static @NonNull Throwable unwrap(final @NonNull Throwable throwable) {
    if(throwable instanceof InvocationTargetException) {
      final /* @Nullable */ Throwable cause = throwable.getCause();
      if(cause != null) {
        return cause;
      }
    }
    return throwable;
  }
1182567
public static boolean isTransientError(Throwable throwable) {
        if (throwable instanceof CouchbaseLiteException) {
            CouchbaseLiteException e = (CouchbaseLiteException) throwable;
            return isTransientError(e.getCBLStatus().getCode());
        } else if (throwable instanceof RemoteRequestResponseException) {
            RemoteRequestResponseException e = (RemoteRequestResponseException) throwable;
            return isTransientError(e.getCode());
        } else if (throwable instanceof java.net.SocketTimeoutException)
            // connection and socket timeouts => transient error
            return true;
        else if (throwable instanceof java.net.ConnectException)
            return true;
        else if (throwable instanceof java.net.SocketException)
            return true;
        else if (throwable instanceof IOException)
            // NOTE: Exception is thrown from HttpClient.execute() or InputStream.read()
            //       As InputStream.read() thrown IOException, So IOException is considered
            //       temporary issue.
            return true;
        else
            return false;
    }
44764
private static function serializeThrowableObject($throwable): string
    {
        $message = \sprintf(
            '[GraphQL] %s: %s[%d] (caught throwable) at %s line %s.',
            \get_class($throwable),
            $throwable->getMessage(),
            $throwable->getCode(),
            $throwable->getFile(),
            $throwable->getLine()
        );

        return $message;
    }
1130205
private final static boolean pstRecursesOnNested(Throwable t) {
        //This method added for D200273

        // the following Throwables don't print out the nested throwable when printStackTrace is called
        Class cName = t.getClass();
        if (cName.getName() != null && cName.getName().equals("org.omg.CORBA.portable.UnknownException"))
            return false;
        if (cName.getName() != null && cName.getName().equals("javax.mail.MessagingException"))
            return false;
        if (t instanceof org.xml.sax.SAXException)
            return false;
        if (cName.getName() != null && cName.getName().equals("javax.servlet.jsp.JspException"))
            return false;
        if (cName.getName() != null && cName.getName().equals("javax.servlet.ServletException"))
            return false;
        if (t instanceof javax.naming.NamingException)
            return false;
        if (t instanceof java.sql.SQLException)
            return false;
        if (cName.getName() != null && cName.getName().equals("javax.jms.JMSException"))
            return false;

        return true;
    }
1180630
@Override
    protected String convertToString(Object value) throws Throwable {
		Link link = (Link) value;
		return link.getValue();
    }
964328
public static String formatThrowable(Throwable throwable) {
    assertInitialization();
    return XLog.sLogConfiguration.throwableFormatter.format(throwable);
  }
1182970
private void sendErrorMessage(Throwable t) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, "Sending a 400 for throwable [" + t + "]");
        }
        sendErrorMessage(StatusCodes.BAD_REQUEST);
    }
517957
public void receiveResponse(Object response_value, Address sender, boolean is_exception) {
        if(isDone())
            return;
        if(is_exception && response_value instanceof Throwable)
            completeExceptionally((Throwable)response_value);
        else
            complete((T)response_value);
        corrDone();
    }
616857
public static Throwable getCause(final Throwable throwable) {
        // Unwrap possibly-nested ExecutionExceptions to get to root cause
        Throwable cause = throwable;
        while (cause instanceof ExecutionException) {
            cause = cause.getCause();
        }
        return cause != null ? cause : new ExecutionException("ExecutionException with unknown cause", null);
    }
1322772
private function handleThrowtable(\Throwable $throwable)
    {
        $message = sprintf("%s %s %d", $throwable->getFile(), $throwable->getMessage(), $throwable->getLine());

        /* @var \Swoft\Http\Message\Server\Response $response */
        $response = RequestContext::getResponse();
        $response = $response->json([$message]);

        return $response;
    }
1308731
private static String makeMessage(Throwable throwable) {
        if(throwable instanceof AlgorithmException) {
            return throwable.getMessage();
        } else {
            final String className = throwable.getClass().getName();
            final String message = throwable.getMessage();
            return className + ": " + message;
        }
    }
1188037
public <T extends Throwable> T throwing(T throwable) {
        if (instanceofLAL) {
            ((LocationAwareLogger) logger).log(THROWING_MARKER, FQCN, LocationAwareLogger.ERROR_INT, "throwing", null, throwable);
        }
        return throwable;
    }