Builds the message containing the contextual information.

@param baseMessage  the base exception message <b>without</b> context information appended
@return the exception message <b>with</b> context information appended, never null
498250
@Override
    @GwtIncompatible("incompatible method")
    public String getFormattedExceptionMessage(final String baseMessage){
        final StringBuilder buffer = new StringBuilder(256);
        if (baseMessage != null) {
            buffer.append(baseMessage);
        }

        if (contextValues.size() > 0) {
            if (buffer.length() > 0) {
                buffer.append('\n');
            }
            buffer.append("Exception Context:\n");

            int i = 0;
            for (final Pair<String, Object> pair : contextValues) {
                buffer.append("\t[");
                buffer.append(++i);
                buffer.append(':');
                buffer.append(pair.getKey());
                buffer.append("=");
                final Object value = pair.getValue();
                if (value == null) {
                    buffer.append("null");
                } else {
                    String valueStr;
                    try {
                        valueStr = value.toString();
                    } catch (final Exception e) {
                        valueStr = "Exception thrown on toString(): " + ExceptionUtils.getStackTrace(e);
                    }
                    buffer.append(valueStr);
                }
                buffer.append("]\n");
            }
            buffer.append("---------------------------------");
        }
        return buffer.toString();
    }
59206
@Override
    public BytesMessage createBytesMessage() throws JMSRuntimeException {

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(this, tc, "createBytesMessage");

        BytesMessage bytesMessage = null;

        try {
            bytesMessage = jmsSession.createBytesMessage();
        } catch (JMSException e) {
            throw (JMSRuntimeException) JmsErrorUtils.getJMS2Exception(e, JMSRuntimeException.class);
        } finally {
            if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
                SibTr.exit(this, tc, "createBytesMessage");
        }
        return bytesMessage;
    }
1093089
public JsJmsBytesMessage createJmsBytesMessage() throws MessageCreateFailedException {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "createJmsBytesMessage");
    JsJmsBytesMessage msg = null;
    try {
      msg = new JsJmsBytesMessageImpl(MfpConstants.CONSTRUCTOR_NO_OP);
    }
    catch (MessageDecodeFailedException e) {
      /* No need to FFDC this as JsMsgObject will already have done so */
      // No FFDC code needed
      throw new MessageCreateFailedException(e);
    }
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "createJmsBytesMessage");
    return msg;
  }
878967
public String getMessage(Context context) {
        if (customMessage != null) {
            return customMessage;
        }
        return context.getResources().getString(message);
    }
872968
public RepeatedFieldBuilder<MType, BType, IType> addMessage(
      MType message) {
    if (message == null) {
      throw new NullPointerException();
    }
    ensureMutableMessageList();
    messages.add(message);
    if (builders != null) {
      builders.add(null);
    }
    onChanged();
    incrementModCounts();
    return this;
  }
372057
protected String createExceptionMessage(Throwable exception, Request request, Response response)
    {
		StringBuilder sb = new StringBuilder(request.getEffectiveHttpMethod().toString());
		sb.append(' ');
		sb.append(request.getUrl());
		sb.append(" threw exception: ");
		sb.append(exception.getClass().getSimpleName());
		return sb.toString();
    }
911979
public BaseMessage processMessage(BaseMessage message)
    {
        RunRemoteProcessMessageData runRemoteProcessMessageData = (RunRemoteProcessMessageData)message.getMessageDataDesc(null);
        if (runRemoteProcessMessageData == null)
            message.addMessageDataDesc(runRemoteProcessMessageData = new RunRemoteProcessMessageData(null, null));
        CreateSiteMessageData siteMessageData = (CreateSiteMessageData)runRemoteProcessMessageData.getMessageDataDesc(CreateSiteMessageData.CREATE_SITE);
        if (siteMessageData == null)
            runRemoteProcessMessageData.addMessageDataDesc(siteMessageData = new CreateSiteMessageData(runRemoteProcessMessageData, null));
        StandardMessageResponseData reply = this.setupUserInfo(siteMessageData);
        if (reply == null)
            return null;
        return reply.getMessage();
    }
1117766
public BaseMessageReceiver getMessageReceiver()
    {
        if (m_receiver == null)
        {
            m_receiver = this.createMessageReceiver();
            if (m_receiver != null)
                new Thread(m_receiver, "MessageReceiver").start();
        }
        return m_receiver;
    }
601487
public BaseMessage convertToThinMessage()
    {
        int iChangeType = ((RecordMessageHeader)this.getMessageHeader()).getRecordMessageType();
        // See if this record is currently displayed or buffered, if so, refresh and display.

        Object data = this.getData();
        BaseMessage messageTableUpdate = null;
        // NOTE: The only way I will send this message to the client is if the ModelMessageHandler.START_INDEX_PARAM has been added to this message by the TableSession
//        if (properties.get(ModelMessageHandler.START_INDEX_PARAM) != null)
        {
            BaseMessageHeader messageHeader = new SessionMessageHeader(this.getMessageHeader().getQueueName(), this.getMessageHeader().getQueueType(), null, this);
            messageTableUpdate = new MapMessage(messageHeader, data);
            messageTableUpdate.put(MessageConstants.MESSAGE_TYPE_PARAM, Integer.toString(iChangeType));
        }
        return messageTableUpdate;
    }
980831
public static String getExceptionMessage(Exception e) {
        if (e.getCause() != null && e.getCause().getMessage() != null) {
            String s = getscard(e.getCause().getMessage());
            if (s != null)
                return s;
        }
        if (e.getMessage() != null) {
            String s = getscard(e.getMessage());
            if (s != null)
                return s;
        }
        return e.getMessage();
    }
1077751
protected final String exceptionMessage(String msg) {
        if (msg == null) {
            msg = "";
        }

        StringBuilder buf = new StringBuilder(128 + msg.length())
            .append(protocol())
            .append(", ")
            .append(authScheme())
            .append(", ")
            .append(proxyAddress)
            .append(" => ")
            .append(destinationAddress);
        if (!msg.isEmpty()) {
            buf.append(", ").append(msg);
        }

        return buf.toString();
    }
751845
public static <T extends Exception> org.hamcrest.Matcher<T> hasMessage(
            String expectedMessage) {
        return new ExceptionMessageMatcher<>(expectedMessage);
    }
1333748
public String getMessage()
  {

    String lastMessage = super.getMessage();
    Throwable exception = m_exception;

    while (null != exception)
    {
      String nextMessage = exception.getMessage();

      if (null != nextMessage)
        lastMessage = nextMessage;

      if (exception instanceof TransformerException)
      {
        TransformerException se = (TransformerException) exception;
        Throwable prev = exception;

        exception = se.getException();

        if (prev == exception)
          break;
      }
      else
      {
        exception = null;
      }
    }

    return (null != lastMessage) ? lastMessage : "";
  }
163501
public static String buildValueMismatchErrorMessage(String baseMessage, Object controlValue, Object actualValue) {
        return baseMessage + ", expected '" + controlValue + "' but was '" + actualValue + "'";
    }
505751
@Override
  public String getMessage() {
    StringBuilder msg = new StringBuilder("\n");

    msg.append(super.getMessage());

    if (detail != null) {
      msg.append("\n");
      msg.append(detail.getMessage());
      if (detail.getCause() != null) {
        msg.append(detail.getCause().getMessage());
      }
    }
    return msg.toString();
  }
586081
public BaseMessage createReplyMessage(BaseMessage messageIn)
    {
        //ProductRequest productRequest = (ProductRequest)messageIn.getMessageDataDesc(null);
        BaseMessage replyMessage = (BaseMessage)this.getMessageProcessInfo().createReplyMessage(messageIn);
        
        //BaseProductResponse responseMessage = (BaseProductResponse)replyMessage.getMessageDataDesc(null);
        //responseMessage.moveRequestInfoToReply(productRequest);
        if (replyMessage == null)
            replyMessage = new TreeMessage(null, null);
        if (replyMessage.getExternalMessage() == null)
            new ExternalMapTrxMessageIn(replyMessage, null);
        return replyMessage;    // Override this!
    }
527395
def check_for_message_exception(cls, message_result):
        
        exception = message_result.exception

        if isinstance(exception, BaseException):
            raise exception