// ConfirmException ( EXCEPTION ) // Verifies that a specific Exception has been raised. // Any other exception will get reraised to be passed // back up to some other error handling routine. // On rare occassions, we may be willing to skip over // more than one exception. So this code has been adapted // to meet that need. Implementing ConfirmException in terms // of ConfirmExceptionList is a deliberate choice. The functions // are really doing the same thing - but we should only allow // more than one exception to slide through unless the script // explicitly states that there are multiple possibilities. // Typical Usage // ConfirmException ( E_WINDOW_NOT_EXPOSED ) ; // ConfirmExceptionList ( E_WINDOW_NOT_EXPOSED, E_WINDOW_NOT_ENABLED ) ; // EXCEPTION_TYPE is used because EXCEPTION is not really a type, // but instead are ennumerated values. We could use exception, and // do some casting, except that we want to be able to handle user defined // exception values ( raise 123, "It broke" ; ) as well as the standard ones. type EXCEPTION_TYPE is integer ; ConfirmException ( EXCEPTION_TYPE exExpectedError ) { ConfirmExceptionList( exExpectedError ) ; } ConfirmExceptionList( varargs of EXCEPTION_TYPE lsExceptions ) { if ! bIsInList( lsExceptions, ExceptNum() ) { reraise ; } } // PrintCall (CALL) // Used to clarify the values of a call when printed in the // log file. The output will still have the Function Name, // FileName, and Line Number, with extra text to align the text. // Typical Use // CALL TempCall ; // for each TempCall in ExceptCalls () // PrintCall(TempCall) ; PrintCall (CALL TempCall) { // Print the Call information which includes the // name of the calling routine and the location of // call in the file. // To be prettied up when time and interest permit. print (TempCall) ; }