Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Very simple question!

 
Angela Jessi
Ranch Hand
Posts: 428
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
If i have one function called open(). It will do some process, afterthat i want to return the error message from that function.
How to return error message in java? Would you please explain by simple example?
Thanks in advance,
angela
 
Art Metzer
Ranch Hand
Posts: 241
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, Angela.
I think you just want to declare that open() throws an exception, then catch it in your code.

Or am I missing something?
Art
 
Angela Jessi
Ranch Hand
Posts: 428
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Art,
But my question is different. Let me more specific.
I have one class , in that I am displaying Error messages in Dialog Box.
I have another class in that I have Open socket method. If there is something wrong in opening socket,I want to return some value which indicates that socket open failed, that value I want to display in Error message class with dialog box. Now Dialog Box will have two buttons: Retry and Cancel. If somebody click on Retry , it should open the socket again.
Plz let me more specification, if you need,
Thanks
angela

 
Angela Lamb
Ranch Hand
Posts: 156
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could put this code in a function, then just call the function again if the user wants to retry.

 
Angela Jessi
Ranch Hand
Posts: 428
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Angela Ann,
Angela
Originally posted by Angela Ann:
[B]You could put this code in a function, then just call the function again if the user wants to retry.
[/B]

 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic