exception_handler_vogui
no way to compare when less than two revisions
Differences
This shows you the differences between two versions of the page.
— | exception_handler_vogui [2018/03/25 17:57] (current) – created wolfgangriedmann | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Exception handler for a VO GUI application ====== | ||
+ | |||
+ | The following code shows the exception message in a VO GUI messagebox. You should combine every exception handler with a logging functionality - a messagebox is gone too easily. | ||
+ | |||
+ | < | ||
+ | static method ProcessException( oException as Exception ) as void | ||
+ | local cMessage as string | ||
+ | local oParent as object | ||
+ | local oBox as TextBox | ||
+ | |||
+ | cMessage := oException: | ||
+ | // log to disk here | ||
+ | do while oException: | ||
+ | // log to disk here | ||
+ | cMessage += CRLF + oException: | ||
+ | enddo | ||
+ | oParent := GetObjectByHandle( GetActiveWindow() ) | ||
+ | if oParent == null_object | ||
+ | oParent := nil | ||
+ | endif | ||
+ | oBox := TextBox{ oParent, " | ||
+ | oBox:Type := BOXICONHAND | ||
+ | oBox:Beep := true | ||
+ | oBox:Show() | ||
+ | |||
+ | return</ | ||
exception_handler_vogui.txt · Last modified: 2018/03/25 17:57 by wolfgangriedmann