Develop > Controller layer > Management Center Web application > Map between the Management Center client and WebSphere Commerce nouns


Manage application errors and system exceptions

The Management Center Web application uses application errors and system exceptions to provide error information.


Application errors

When you invoke a service, the service request might not be processed because of information that is specified in the request BOD. If the request cannot be processed, the response BOD contains error information in the change status element within the response Verb. In the WebSphere Commerce OAGIS processing model, the Management Center assumes that application errors have occurred when the response BOD is populated with change status information and the change status element contains the error information. The following example shows a response BOD with error information:

<Oagis9:Acknowledge>
<Oagis9:ResponseCriteria>
<Oagis9:ChangeStatus>
<Oagis9:Code>cc57ffe0-4f41-11dc-81df-832f46c9cd9c</Oagis9:Code>
<Oagis9:Description>CMN0206E Please check all fields. "logonId" is a required field.</Oagis9:Description>
<Oagis9:ReasonCode>_ERR_CMD_MISSING_PARAM+2010</Oagis9:ReasonCode>
</Oagis9:ChangeStatus>
</Oagis9:ResponseCriteria>
</Oagis9:Acknowledge>

Error information that is sent from the response OAGIS messages is managed by the exception framework in the Management Center programming model. When the input to the client methods cannot be converted into valid input to the request BOD, this exception framework includes mediation validation logic. Regardless of whether the exception is due to invalid input that cannot be mediated or an error response from the server, the exception is represented as an AbstractBusinessObjectDocumentException. This exception framework includes the concept of ClientErrors, which is a list of errors that is associated with the request. Since the Management Center might have multiple validation errors or the server might return multiple validation errors, the Management Center only needs to manage the Management Center object.

However, when the Management Center invokes a service that produces one or more application errors, the XML document that is returned is an error document that lists the validation errors that occurred. Each validation error contains the error message in the locale specified by the user of the Management Center and optionally the associated parameter that corresponds to the validation error. This parameter helps the Management Center shell to identify the specific parameter that requires attention, instead of just displaying an error. If no parameter is specified, the Management Center assumes that the message applies to the object that it sent as part of the request. The following example shows a validation error result:

<errors>
<validationError>Invalid price.</validationError>
<validationError propertyName=name>Name must be alphanumeric.</validationError>
</errors>

The Management Center Web application mediation between the Management Center and WebSphere Commerce services includes the mediation of URL requests to OAGIS requests and Nouns to Management Center objects. This mediation must also manage validation errors that are returned by the server. When validation errors are returned by the response BOD, the Management Center Web application mediates these errors into the format that is expected by the Management Center. This mediation includes mapping a specific error message to a client object property. It might also include changing the message to make it more meaningful to the Management Center.


System exceptions

System exceptions are exceptions that occur because of reasons outside the user's control and cannot be resolved by the user. The user interface displays generic error messages to provide details on the problem to the user and the exception text is logged in the Management Center Web application for administrators to read.

<errors>
<exception>An unexpected problem occurred while processing the request. Please contact you administration for further assistance.</exception>
</errors>

Not all system exceptions return the same message. You can customize certain exceptions to return custom messages instead of the generic message. These custom messages provide more meaningful information to administrators.


Related tasks

Map of validation error reason codes


+

Search Tips   |   Advanced Search