OnError Event  

The client encountered an error when handling a client request.


Sub object_OnError ( [Index As Integer,] ByVal ClientId As Variant, ByVal ErrorCode As Variant, ByVal Description As Variant )


An integer value which uniquely identifies the client session.
An integer value which specifies the error that has occurred.
A string that describes the error.


The OnError event occurs whenever the server encounters an error while accepting a client connection or processing a request. It is important to note that this event is not raised for every error that occurs. The following are some common situations in which this event handler may be invoked:

  • A network error occurs when the client connection is being accepted by the server. This could be the result of an aborted connection or some other lower-level failure reported by the networking subsystem on the server.
  • The server is configured to use implicit SSL but cannot obtain the security credentials required to create the security context for the session. Usually this indicates that the server certificate cannot be found, or the certificate does not have a private key associated with it. It could also indicate a general problem with the cryptographic subsystem where the client and server could not successfully negotiate a cipher suite.
  • A network error occurs when attempting to process a command issued by the client. This usually indicates that the connection to the client has been aborted, either because the client is not acknowledging the data that has been exchanged with the server, or the client has terminated abnormally. This event will not occur if the client terminates the connection normally.

In most situations where this event handler is invoked, the error is not recoverable and the only action that can be taken is to terminate the client session.

See Also

LastError Property, LastErrorString Property, ThrowError Property