• Post Reply Bookmark Topic Watch Topic
  • New Topic

Question regarding exception handling... java.net.ConnectException  RSS feed

 
Dalton Curtin
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
First off Howdy,
student of programming working on an assignment. It's a messenger that sends packets to a server which in turn sends packets to a multicast distributor. Right now I'm trying to tidy up the gui elements and want to add an exception handle for when the teacher decides to put nothing or rubbish as the ip address. I understand this exception that's being thrown but for some reason i can't get my head around how to wrap it up in a proper try catch block.

feel welcome to slap my head if this has come up before around here, but honestly I couldn't find anything regarding the setting up of the exception, Just what the exception meant.
 
Stephan van Hulst
Saloon Keeper
Posts: 6981
110
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Dalton, welcome to CodeRanch!

I'm not sure what problem you are having. Do you understand how try-catch statements work? If so, what's stopping you from catching this particular exception?
 
Dalton Curtin
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey sir,
Thank you for the quick response... I found out, everything of my try-catch block was correct except the placement. Have been working on this with no sleep so silly mistakes were bound to be made xD Feel like this assignment has been playing tricks on me from the get-go anyhow... that multicasting can be tricky
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!