Geeks Talk

Prepare for your Next Interview


Welcome to the Geeks Talk forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact us.

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 throw an ...

Go Back   Geeks Talk > Software Development > VB.NET
Register Blogs FAQ Tag Cloud Calendar Mark Forums Read

VB.NET Visualbasic.NET

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-30-2007
Expert Member
 
Join Date: Oct 2006
Posts: 689
Thanks: 0
Thanked 53 Times in 44 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


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:50 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.3.1
Copyright © 2009 GeekInterview.com. All Rights Reserved