User Tools

Site Tools



This shows you the differences between two versions of the page.

Link to this comparison view

exception_handler_vogui [2018/03/25 19:57] (current)
wolfgangriedmann created
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.
 +<code>static class ExceptionHandler
 +static method ProcessException( oException as Exception ) as void
 +local cMessage as string
 +local oParent as object
 +local oBox as TextBox
 +cMessage := oException:Message
 +// log to disk here
 +do while oException:InnerException != NULL_OBJECT
 +  // log to disk here
 +  cMessage += CRLF + oException:Message
 +oParent := GetObjectByHandle( GetActiveWindow() )
 +if oParent == null_object
 +  oParent := nil
 +oBox := TextBox{ oParent, "Error", cMessage }
 +oBox:Type := BOXICONHAND
 +oBox:Beep := true
exception_handler_vogui.txt ยท Last modified: 2018/03/25 19:57 by wolfgangriedmann