all groups > dotnet remoting > june 2007 >
You're in the

dotnet remoting

group:

HWta is the best common way ? (loosing my hairs...stil one)


HWta is the best common way ? (loosing my hairs...stil one) calderara
6/1/2007 8:07:00 AM
dotnet remoting:
Dear all,

I start to loos my hairs , hope anyone could help me to avoid loosing more.
I have build a remoting component host in a window service which is in
charge to store data to SQL database if everything works fine.

I have using it as server-activate and singleton mode with tcp chanel
Everything works fine when no erro occurs.

Now my simple question is :
What is the best way to informed my client application which place a call to
my server, that something went wrong fro instance when storing data ?

My client for instance is placing a call to a Send() method in my remote
object. I have try to get return Treu or false from my Send method, but from
client side did not receive it.

I have try to implement a GetLastError() public method from my remote
aplpciation , that my cilent can call to get an error message string. Eeems
toi be the same..

I am now thinking to throw custom exception from my server object, that my
client must implement in case something goes wrong... But might be not a good
way.

I could of cours send the full exception descriprtion to eventlog, but for
my final user and for security reason I would like to return to my user a
more simple message like (" Insert data failed")

How to do then in proper and simple way ?

thnaks for hlep
Re: HWta is the best common way ? (loosing my hairs...stil one) Thomas
6/6/2007 3:35:08 PM
You can throw exception on the server side and catch it on the client
one - where you expect it could happen (I assume you would wrap the call
of the Send method with try/catch block). On the client side you can
display user friendly message instead of exception message.

Regards,
Thomas

-----------------------------------------
NConstruct - Intelligent Software Factory
http://www.nconstruct.com
-----------------------------------------




[quoted text, click to view]
AddThis Social Bookmark Button