Quantcast
Channel: Embarcadero Community - Embarcadero Community
Viewing all articles
Browse latest Browse all 3212

Datasnap TDSServer.OnError - unable to trigger

$
0
0

TDSServer documentation says the following about the OnError event:

"Occurs when exceptions are raised during execution of server method.

Use this event to receive notification of exceptions that are raised during the execution of a server method."

 

I've raised Exceptions and TDBXErrors in simple Server Methods (like ReverseString, EchoString) in order to trigger this event, and the event is not triggered. I can see OnConnect, OnDisconnect and OnPrepare being triggered. 

 

Am I using OnError event correctly?  I was hoping to make my on Exceptions and provide custom HTTP RepsonseCodes and ResponseMessage via TDSInvocationMetaData depending on the type of exception raised.

 

If this is not the correct use of the OnError event, are there any suggestions on where to set my InvocationMetaData if something goes wrong in my Server Methods? Or a link, or discussion about it?

 

TIA.


Viewing all articles
Browse latest Browse all 3212

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>