Results 1 to 2 of 2

Thread: throwexception from function to function

  1. #1
    Expert Member
    Join Date
    Oct 2006
    Answers
    209

    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.


  2. #2
    Junior Member
    Join Date
    Jun 2007
    Answers
    3

    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")
    ...


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Applying for a job can be a stressful and frustrating experience, especially for someone who has never done it before. Considering that you are competing for the position with a at least a dozen other applicants, it is imperative that you thoroughly prepare for the job interview, in order to stand a good chance of getting hired. That's where GeekInterview can help.
Interact