Class ServerErrorException

All Implemented Interfaces:
IErrorException, IXMLMarshallable, OperationResult, XMLMarshallable, Serializable

public class ServerErrorException extends OperationFailureErrorException
Exception thrown when a nonbusiness exception occurred in the connected SAP CC Core Server system; If such an exception occurs, it does not relate to a software bug in the SAP CC system (except for the "unsupportedFailure" reason that denotes a potential existing bug).

This marshallable exception is used to transform in a single common exception a large set of internal exceptions (runtimes exception for most of them) which can occur on server side. That the reason why this exception manages a nested Throwable attribute which is initialized with the original exception. But this nested exception is NEVER transmitted to your client application. The Throwable class is the superclass of all errors and exceptions in the Java technology.
However, on server side, each time a server failure exception is created from an internal exception, the SAP CC system always records the nested (internal) exception stack trace into the logs or traces; this concerns also the generated ServerFailureException.

  • Cause
  • Caused By

Implementation in Your Client Application

Error Handling

When your client application receives such an exception, it means that the initial operation request did not succeed and any change has been performed into the back-end database system. The database transaction has been rollbacked.

Use the method OperationFailureErrorException.getMessage() to retreive detail the message of the nested exception if it exists.

See Also:

XML API for HCI

The XML APIs specify the following XSD fragment:

XSD Fragment

<xs:element name="serverError">
   <xs:complexType>
     <xs:sequence>
       <xs:element ref="cause" minOccurs="1" maxOccurs="1"/>
       <xs:element ref="causedBy" minOccurs="0" maxOccurs="unbounded"/>
     </xs:sequence>
   </xs:complexType>
 </xs:element>

  • Field Details

    • TAG_NAME

      public static final String TAG_NAME
      The XML tag name of the XML representation: "serverError"
      See Also:
  • Constructor Details

    • ServerErrorException

      public ServerErrorException()
      Builds an empty exception.
    • ServerErrorException

      public ServerErrorException(IError error)
      Builds an exception with the error which has triggered it.
      Parameters:
      error - The error which has triggered the exception
    • ServerErrorException

      public ServerErrorException(IError error, OperationFailureErrorException exception)
      Builds an exception with an error and the OperationFailureErrorException which has triggered it.
      Parameters:
      error - The error of the exception
      exception - The exception which has triggered the current one
    • ServerErrorException

      public ServerErrorException(IError error, Throwable throwable)
      Builds an exception with an error and the Throwable which has triggered it.
      Parameters:
      error - The error of the exception
      throwable - The throwable which has triggered the current one
  • Method Details

    • setAttributes

      public void setAttributes(XMLAttributes atts)
      Description copied from interface: XMLMarshallable
      Sets the attributes of the XML representation of the element being processed.
      Parameters:
      atts - The XML attributes of the current element
    • addCharacterData

      public void addCharacterData(String cData)
      Description copied from interface: XMLMarshallable
      Adds character data to the content element.
      Parameters:
      cData - The character data to be added
    • getTagName

      public String getTagName()
      Description copied from class: OperationFailureErrorException
      Gets the XML tag name of the HCI model.
      Specified by:
      getTagName in class OperationFailureErrorException
      Returns:
      The XML tag name
    • marshalAttributes

      public void marshalAttributes(XMLOutputter output)
      Description copied from interface: IXMLMarshallable
      Gives an XML representation of the attributes of an object.
      Parameters:
      output - The XML output to marshal the object attributes into