RTC Forums

Subscription => Support => Topic started by: DPerkins on January 03, 2014, 03:54:46 PM



Title: How are server errors handled?
Post by: DPerkins on January 03, 2014, 03:54:46 PM
If on the server I encounter an error when processing a request, is it up to me to devise a method to send that error back to the client?  Let's say that an exception is thrown in an TRtcFunction.OnExecute routine.  Does RTC silently handle it, or should it be propagated back to the client?  I thought I had read that the latter was correct, but the former is happening.


Title: Re: How are server errors handled?
Post by: D.Tkalcec (RTC) on January 03, 2014, 04:57:51 PM
Exceptions that get out of the OnExecute event connected to the TRtcFunction component will be caught by the TRtcServerModule and sent back to the client with Result.asType = rtc_Exception and the Result.asException containing the exception message. But that is just the default. It unless the exception is a result of bad function usage, it would be better if you would handle it on the Server side and let the Client know what's wrong by sending a custom result.

Best Regards,
Danijel Tkalcec