Geeks Talk

Prepare for your Next Interview




throwexception from function to function

This is a discussion on throwexception from function to function within the VB.NET forums, part of the Software Development category; Suppose there are 2 functions and i need to throw the exception from one function to other function how do i do that?ex:func1() and func2() I need to ...


Go Back   Geeks Talk > Software Development > VB.NET

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 05-30-2007
Expert Member
 
Join Date: Oct 2006
Posts: 690
Thanks: 0
Thanked 49 Times in 41 Posts
JobHelper is on a distinguished road
throwexception from function to function

Suppose there are 2 functions and i need to throw the exception from one function to other function how do i do that?ex:func1() and func2() I need to throw an exception from func1() and need to catch it in func2()

Thanks,

Question asked by ashwini.
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 06-25-2007
Junior Member
 
Join Date: Jun 2007
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Portorp is on a distinguished road
Re: throwexception from function to function

in func2() something like this:

Try
func1()
Catch ex as Exception
' Handle the exception
Finally
' Cleanup code, always executed regardless of the exception
End Try

and in func1():
...
Throw new Exception("My message")
...
Reply With Quote
Reply

  Geeks Talk > Software Development > VB.NET


Thread Tools
Display Modes


Similar Threads

Thread Thread Starter Forum Replies Last Post
How does indexes function? Lokesh M SQL 10 10-07-2007 02:13 PM
Function overloading example vicky19772003 Java 6 05-22-2007 10:43 AM
pl/sql function gujjar Oracle Certification 3 02-22-2007 10:47 AM
TSL Function sutnarcha WinRunner 1 12-20-2006 05:40 AM
Function in PHP sripri PHP 1 07-20-2006 12:13 PM


All times are GMT -4. The time now is 05:17 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Copyright © 2008 GeekInterview.com. All Rights Reserved