docs: private void addException(Throwable e, short exceptionId, String probeId)
     {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "addException",
                                             new Object[]{e, exceptionId, probeId});
  
  
        // First make the exception message if there was one. If it was an internal error, add the
        // toString() to the message as this will indicate what the exception was. Otherwise, just
        // add the message.
        String exceptionMessage = null;
        if (exceptionId == CommsConstants.EXCEPTION_INTERNAL_ERROR)
        {
           exceptionMessage = e.toString();
        }
        else
        {
           exceptionMessage = e.getMessage();
        }
  
        // Work out the data items that will be returned
        short noOfDataItemsReturned = 0;
        if (exceptionMessage != null) noOfDataItemsReturned++;
        if (probeId != null) noOfDataItemsReturned++;
        if (e instanceof XAException) noOfDataItemsReturned++;
  
        // Now add the exception Id and number of data items on top of the list of this load of
        // exceptions
        putShort(exceptionId);
        putShort(noOfDataItemsReturned);
  
        if (exceptionMessage != null)
        {
           if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(tc, "Adding message: " + exceptionMessage);
           putShort(CommsConstants.DATAID_EXCEPTION_MESSAGE);
           putString(exceptionMessage);
        }
  
        // Now add the probe ID if there was one
        if (probeId != null)
        {
           if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(tc, "Adding probe ID: " + probeId);
           putShort(CommsConstants.DATAID_EXCEPTION_PROBEID);
           putString(probeId);
        }
  
        // If the exception is an XAException we need to return the reason code to
        if (e instanceof XAException)
        {
           int reasonCode = ((XAException) e).errorCode;
           if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(tc, "Adding reason code: " + reasonCode);
  
           putShort(CommsConstants.DATAID_EXCEPTION_REASON);
           putShort(4);
           putInt(reasonCode);
        }
  
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "addException");
     }