cancel
Showing results for 
Search instead for 
Did you mean: 
Subscribe

We're having troubles with application crashes, some are probably due to PowerBuilder itself, many are probably due to our code having issues under certain circumstances. So I have the following questions:

1. Does anyone know if it possible to put a try... catch... around say the application open event and therefore catch all unexpected crashes? In which case we may be able to log the error and at least exit gracefully in some manner

2. Does anyone know a way of making Powerbuilder crash on command? I mean the PBVM itself? I was thinking to try a divide by zero error, but I assume this is captured by the PBVM itself and handled more gracefully than a PBVM crash. I guess I could just create a zillion datastores until Windows runs out of memory.

Thanks

0 Likes
View Entire Topic
Former Member
0 Likes

Hi Aron;

Q1: try... catch... around say the application open event

A1: That would only catch an error in the processing chain of the Open event. Once the Open event is completed, the Try..Catch would be out-of-scope.

    Do you have proper code in the SystemError event of the Application object class to intercept & log any errors?

Q2:  Does anyone know a way of making PowerBuilder crash on command?

A2: Try the undocumented GPF ( ) method.  

Regards ... Chris

Former Member
0 Likes

Isn't there any top level code in PowerBuilder that is in scope for the whole running of an application? Boy, I've been doing too much C# recently, starting to forget everything about PowerBuilder!

I know we have something in the SystemError event, I shall have to have a look at it. It was written by someone else many, many years ago.

Former Member
0 Likes

Q: Isn't there any top level code in PowerBuilder that is in scope for the whole running of an application?

A: No, not in a visible GUI application where the processing is dependent on an Event driven model. The only entity in control in this case would be the PBVM itself. In a Batch application where your basically in a tight processing loop - then you could wrap the Loop in a Try..Catch as typically coming out of this loop the batch application closes.

  Speaking of the PBVM though ... have you tried running your PB application EXE using the internal tracing option? FYI:  Invoke the executable file using the /pbdebug command-line switch, for example:  EXEFILE   /pbdebug

    The trace file might tell you at the time of the crash at least what was processing and where within your application and/or PBVM when the non-recoverable issue happened.

Food for thought.

Former Member
0 Likes

Ah yes forgot about that, but if I remember rightly it really, really slows everything down, to the point where it's impossible to use?