Scripting the Error event – PB Docs 125

Scripting the Error event

What you do

To handle errors in the Error event of the Connection object,
you create a user object that customizes the definition of the object.
Once you have created the custom Connection object, you can refer
to it anywhere in your scripts where you use a Connection object. If you
use the JaguarORB event, you can script its Error event in the same
way.

The Connection Object wizard creates a custom Connection object
for you. See “Using the wizard
to create a Connection object”
.

Arguments to the Error event

The Error event of the custom Connection object has several
arguments that provide information about the condition that caused
the error. For example, these arguments provide the error number
and error text, as well as the name of the object that caused the
error and the full text of the script where the error occurred.

In addition to the arguments that provide error information,
the Error event has an argument that lets you specify what action
to take. To specify the action, you assign one of four enumerated
values (ExceptionFail!, ExceptionRetry!, ExceptionIgnore!,
or ExceptionSubstituteReturnValue!) to the
Action argument of the Error event.

Example

In this example, the Error event script informs the user of
the condition that caused the communications error and gives the
user the opportunity to control what happens next. Depending on
the user’s input, the client application fails, retries
the operation, or ignores the error and continues processing:


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