1. Andrew Davis
  2. PowerBuilder
  3. Wednesday, 14 March 2018 15:21 PM UTC

Hi All

Is there a best practice / recommendation about what to put into the systemerror event

I have a messagebox that shows the

error.number, line, object, windowmenu, text

The reason i ask is i am getting a few crashes - when working in the IDE - I am not far enough into my project to see if it happens compiled 

Is there any extra error handling that i shoud be doing 

regards and thanks in advance

 

Andrew

Michael Kramer Accepted Answer Pending Moderation
  1. Thursday, 15 March 2018 12:47 PM UTC
  2. PowerBuilder
  3. # 1

Hi Andrew,

SystemError event is last-resort with limited recovery options. Also, context info is limited to what the Error object can tell you. And even if you decide to recover (i.e. let your application continue) your call stack has been flushed.

I suggest you consider using exception handling because you can localize recovery and error corrections. Also, your code can recover and continue when that is a relevant recovery action. Where SystemError is application wide, your TRY-CATCH can be implemented at whatever position in your code, you find relevant.

I prefer using exception handling - especially when calling web services, using OLE Automation, or otherwise interacting with code that throws exceptions.

 

Anyways, the previous answers are definitely worth pursuing when you have to do error handling in the SystemError event.

HTH /Michael

Comment
There are no comments made yet.
Roland Smith Accepted Answer Pending Moderation
  1. Wednesday, 14 March 2018 17:36 PM UTC
  2. PowerBuilder
  3. # 2

It is pretty common for applications to record system/database errors in a database table. You can add an error viewer window to the app or as a separate program.

Comment
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Wednesday, 14 March 2018 15:47 PM UTC
  2. PowerBuilder
  3. # 3

Hi Andrew;

   I have extensive error handling in my frameworks. You are most welcome to check out the code and borrow whatever you need to add to your error handling requirements. My suggestion is to download the example OrderEntry App built from the frameworks and check out the System Error event coding on the Application object and then the corresponding "oe_systemerror" event of the Application Controller (nc_app_controller_master).

  Note that the code in the "oe_systemerror" event will handle:  Native, Windows Service, Windows System Tray,  Web and Mobile (PowerServer) based running Apps.

HTH

Regards ... Chris

 

Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.