Connection Information

To perform the requested action, WordPress needs to access your web server. Please enter your FTP credentials to proceed. If you do not remember your credentials, you should contact your web host.

Connection Type

THROW – PB Docs 125 – PowerBuilder Library

THROW – PB Docs 125

THROW

Description

Used to manually trigger exception handling for user-defined
exceptions.

Syntax

Parameter

Description

exlvalue

Variable (or expression that evaluates
to a valid instance of an object) of type Throwable. Usually the
object type thrown is a user-defined exception class derived from
the system Exception class that inherits from Throwable.

Usage

The variable following the THROW reserved
word must be a valid object instance or an expression that produces
a valid object instance that derives from the Throwable datatype.
For example, you can use an expression such as:

where ExceptionType is an object of type
Throwable.

If you attempt to throw a noninstantiated exception, you will
not get back the exception information you want, since the only
exception information you retrieve will be a NullObjectError.

In a method script, you can only throw an exception that you
declare in the method prototype or that you handle in a try-catch
block. The PowerScript compiler displays an error message if you
try to throw a user-defined exception without declaring it in the
prototype Throws statement and without surrounding it in an appropriate
try-catch block.

When a RuntimeError, or a descendant of RuntimeError, is thrown,
the instance variable containing line number information will be
filled in at the point where the THROW statement
occurs. If the error is handled and thrown again, this information
will not be updated unless it has specifically been set to null.

Examples


Document get from Powerbuilder help
Thank you for watching.
Was this article helpful?
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x