TsgcWSPServer_DatasetEvents › OnException

OnException Event

Fires when an unhandled exception is raised while processing a connection.

Syntax

property OnException: TsgcExceptionEvent;
// TsgcExceptionEvent = procedure(Connection: TsgcWSConnection; E: Exception) of object

Default Value

Remarks

Centralised hook for exceptions raised while applying client updates to the dataset or while serialising records. The exception has already been caught; if you want it to propagate further, re-raise it from the handler. E is owned by the component and becomes invalid after the event returns, so copy E.Message if you need to log it asynchronously.

Example

procedure TForm1.oProtocolException(Connection: TsgcWSConnection; E: Exception);
begin
  Memo1.Lines.Add('unhandled: ' + E.ClassName + ' - ' + E.Message);
end;

Back to Events