You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to UBC CPSC 210
I was just wondering when do you catch an exception and when do you
propogate it?
thanks
Paul Carter
unread,
Apr 25, 2011, 7:58:36 PM4/25/11
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to ubc-cp...@googlegroups.com
In general, you will propagate the exception back through the call chain to the point in the code that is best able to deal with the error that led to the exception. At that point you catch the exception and deal with the problem as best you can. Note that in some situations, "dealing with the problem" might involve notifying the user that something critical has gone wrong (e.g. can't connect to the network) and then terminating the program, while in others we might be able to fix the problem (e.g. ask the user to re-enter some value when the original input was not valid) and continue.