3.3.5.1.2 Error Handling

There are two types of error mechanisms that exist in the RDS Transport Protocol: rdsMethodResponseError and rdsErrorInformation<77>. Every request type has a corresponding response type (for example, rdsExecuteRequest and rdsExecuteResponse). The biggest difference between the error mechanisms is that rdsMethodResponseError is sent instead of the request's corresponding response (for example, responding to an rdsExecuteRequest with an rdsMethodResponseError), whereas rdsErrorInformation is sent as part of the normal server response. The rdsErrorInformation mechanism MUST NOT be used unless the normal response can contain an rdsErrorInformation without violating its syntax rules. For the RDS Data Factory Message Set, this effectively means that the rdsErrorInformation mechanism can be used in responding to an rdsExecuteRequest or rdsSynchronizeRequest, but MUST NOT be used for responding to an rdsQueryRequest.

Every error that occurs on the server in the course of RDS Transport Protocol processing has a corresponding 4-byte SCODE field (found in VARIANTERROR). The following table specifies the values and meaning of SCODEs that the server returns as part of using the rdsMethodResponseError mechanism.

SCODE

Meaning

%x00.00.04.80

(EOutOfMemory)

The server had insufficient memory for processing the request.

%x01.00.04.80

(ENotImpl)

The server does not implement the requested functionality.

%x02.00.04.80

(ENoInterface)

The server does not implement an interface required for the operation.

%x04.00.04.80

(EAccessDenied)

The operation requested was aborted.

%x05.00.04.80

(EFail)

The requested operation resulted in a failure.

%x 09.00.02.80

(DispEException)

Methods or properties of an object cannot be accessed.

%x57.00.07.80

(EInvalidArgument)

One or more elements of the request message was missing, invalid, or malformed.

If the rdsMethodNamespace is unrecognized, the server MUST use the rdsMethodResponseError mechanism and set the SCODE to %x57.00.07.80.

If the rdsMethodName is unrecognized, the server MUST use rdsMethodResponseError mechanism and set the SCODE to %x02.04.00.80.

The rdsQualifiedMethodName uniquely identifies the request type, and therefore the request type's corresponding syntactic constraints. When a request arrives and the syntactic constraints are violated, the server MUST respond using the rdsMethodResponseError mechanism and SHOULD set the SCODE to %x57.00.07.80.

After the request has been recognized and parsed, the following rules SHOULD be followed:

  • For catastrophic failures listed in the preceding SCODE table, use the rdsMethodResponseError mechanism, and set the SCODE's most significant bit (in little-endian notation, this corresponds to the bitmask %x00.00.00.80) to 1.

  • For errors in connecting to the data store, retrieving or manipulating data, or serializing the data, use the rdsErrorInformation mechanism to report all of the errors that have occurred. The exception to this rule is when the server is responding to an rdsQueryRequest, in which case it SHOULD use the rdsMethodResponseError mechanism and return the single most severe error.

  • For errors in constructing the response, the server uses the rdsMethodResponseError mechanism and returns the single most severe error.

Relevant examples of error messages are provided in section 4.

The RDS Transport Protocol server MUST process any shape commands (see section 3.3.5.2.4).

The RDS Transport Protocol server MUST process the rdsSQLCommandParameters array according to the algorithm in section 3.3.1.3.

The RDS Transport Protocol server SHOULD<78> send the SQL-92 commands to the data store specified in the rdsConnectionString. The RDS Transport Protocol server SHOULD handle the SQL command Execution Timer (see section 3.3.2.1). If the timer fires, RDS Transport Protocol server MUST return an error to the client using the error processing rules in this section and assign an appropriate SCODE.

The RDS Transport Protocol server then builds up a local RecordSet to accumulate results coming from the backend data stores.

The RDS Transport Protocol server MUST then construct an rdsExecuteResponse. The RecordSet is used to create the TableGram property. The contents of the rdsExecuteResponse are sent back to the client in the Reply.