Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 164
  • Last Modified:

Determine Exception

When an exception is thrown how do I know what exception that is so I could change the message that is displayed?
0
Gunit2507
Asked:
Gunit2507
1 Solution
 
vadim63Commented:
You can find an exeption as

Try
....
Catch ex As Exception
       MsgBox(ex.Message)   ' or  full exeption: MsgBox(ex.ToString)
End Try

and then you can change this block for example:

        Try
.....
        Catch ex As NullReferenceException
            MsgBox(CustomMessage)
        End Try
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now