TsgcWSPClient_Presence › Events › OnErrorPublishMsg
Fires when the server rejects a publication with an error.
property OnErrorPublishMsg: TsgcWSPresencePublishMsgErrorEvent;
// TsgcWSPresencePublishMsgErrorEvent = procedure(Connection: TsgcWSConnection; const aError: TsgcWSPresenceError; const aMsg: TsgcWSPresenceMsg; const aChannel: TsgcWSPresenceChannel; const aMember: TsgcWSPresenceMember) of object
—
Fires on the publisher when a Publish call fails on the server (for example because the channel does not exist, the sender is not subscribed to it, or a server-side rule denies the message). aError describes the reason, aMsg / aChannel / aMember identify the rejected publication.
procedure TForm1.oPresenceErrorPublishMsg(Connection: TsgcWSConnection;
const aError: TsgcWSPresenceError; const aMsg: TsgcWSPresenceMsg;
const aChannel: TsgcWSPresenceChannel; const aMember: TsgcWSPresenceMember);
begin
Memo1.Lines.Add(Format('Publish rejected (%d): %s',
[aError.Code, aError.Text]));
end;