Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Sockets and Server Exceptions

 
Luiz Reginaldo Curado
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In my assignment I'm thinking in always send to a socket client a ResponseVO, and this object will have a field named "errorMessage". So, the socket client read this field and, if necessary, throws a Exception to be catched in the client GUI to show a message.

In the "local" approach I also send such Exception to the client GUI.

Is it a good approach? What you think?
 
Jeremy Botha
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm doing something similar, though it involves classes ClientRequest and ServerResponse, both of which are abstract and define methods which indicate whether an error occurred and if so, allow the client to retrieve the error description. I then extend these messages for various functions such as Login, Search etc.

Any errors which occur then get propagated upwards to my error handling framework.

Jeremy
 
Ziji (Jay) Zhang
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am reading the book by Max. why not define a object similar to DVDResult, DVDCommand and pass them through the socket?
You can wrap any kind of Exception within DVDResult.
Thanks.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic