Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

throwing exceptions

Status
Not open for further replies.

thedougster

Programmer
Jan 22, 2009
56
US
The documentation I've found is a little hazy on this subject, so it's time to fire off yet another no-doubt ignorant question:

Is "throw" intended exclusively for the following scenario: Control is transferred out of a try block via a method call, and code in the called method then detects an exception, so the called method uses "throw" to transfer control back to the appropriate catch block associated with the original try block?
 
not sure about the academic answer, but the practical answer is throw; and throw new Exception(...); are used to set the starting point of a stack trace to locate the exception.

there are rules/guidelines for how best to work with exceptions, but i don't think that's what your asking.


Jason Meckley
Programmer
Specialty Bakers, Inc.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top