How to raise an exception in VB.NET

You would throw a new exception.

Have a look at Throw Statement (Visual Basic)

The Throw statement throws an exception that you can handle with
structured exception-handling code (Try…Catch…Finally) or
unstructured exception-handling code (On Error GoTo). You can use the
Throw statement to trap errors within your code because Visual Basic
moves up the call stack until it finds the appropriate
exception-handling code.

EDIT

By request and from the link

Throw New System.Exception("An exception has occurred.")

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)