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

Exception handling and debugging – PB Docs 2022 – PowerBuilder Library

Exception handling and debugging – PB Docs 2022

Exception handling and
debugging

To handle errors, you use the error codes returned from PBNI
methods. Some functions of the IPB_Session interface return detailed error
codes that make debugging easier.

Native methods, such as the IPBX_UserObject Invoke method, return
either PBX_OK or PBX_FAIL if the extension encounters a serious problem
from which it cannot recover.

Whenever the PowerBuilder VM gets PBX_FAIL from a native method, it
throws a PBXRuntimeError in the PowerBuilder application. PBXRuntimeError
inherits from the PowerBuilder RuntimeError system object and can be
caught and handled in a script in the same way as any exception in
PowerBuilder.

To catch these errors, wrap your PowerScript call in a try-catch
block as follows:

The IPB_Session interface provides a set of methods to handle
exceptions that occur in native code. Use HasExceptionThrown to
determine whether an exception occurred. If it did, use GetException to get the current
exception object so that it can be handled. If necessary, you can throw
exceptions to PowerBuilder with ThrowException. When an
exception has been handled, use ClearException to clear
it.

Debugging

You cannot edit a native class in the PowerBuilder development
environment, and you cannot enter native methods in the PowerBuilder
debugger because the methods are C++ methods. You must use a C/C++
debugger to debug an extension module.


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