Scripting the SystemError event

What you do

In the SystemError event of the Application object, you can write a script to tell PowerBuilder to halt application execution or ignore the error.

Example

In this example, the SystemError event script displays a message informing 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 halts execution or ignores the error and continues processing:

string ls_logline = "SYSTEM ERROR: "
ls_logline += String(error.number) + " " + error.text

ls_logline += " occurred at line " + &
		String(error.line) + " "
ls_logline += " in event " + error.objectevent
ls_logline += " of object " + error.object

if Messagebox("System Error", ls_logline + &
	"~r~n~r~nDo you want to stop the program?", &
	Question!, YesNo!) = 1 then
	HALT CLOSE
end if