Procedure ErrorQueueStart
Call: | Send ErrorQueueStart |
Normally, all errors are handled and processed as they occur. It is possible to queue errors and process them later. ErrorQueueStart starts an error queue process. All errors in the error queue are cleared and error queueing is enabled. Once this message is started, all errors, rather than be immediately reported, will be added to an error queue. Errors are added to the queue when an error occurs (either runtime generated or generated via the Error command) and when LogErrorEvent message is sent. Note that critical errors are not queued and are reported immediately.
Errors will be queued until the ErrorQueueEnd message is sent.
Usually this processing will occur after ErrorQueueEnd has been sent. Errors in the queue can be inspected and processed using a provided interface. Note that indexes are zero based:
ErrorCount - returns the number of items in the queue queue.
ErrorNumber - returns the error number for an index
ErrorMessage - returns the error text for an index. When used by a cWebAspClassicObject object, the message will be HTML encoded.
ErrorMessageDetailed - returns more technical error text for an index.
ClearErrors - clears the error queue. This is sent automatically when ErrorQueueStart is sent.
IsQueuedError - determines if errors are currently being queued. If you are unsure if errors are being queued, you should check IsQueuedError before starting a new error queue.
Normally errors are not queued. If you want to queued errors, you must code this yourself:
Procedure DoSomething Integer iErrs iError iIndex String sError // : Send ErrorQueueStart // : do the process Send ErrorQueueEnd // handle any errors Get ErrorCount to iErrs // any errors If iErrs Begin For iIndex from 0 to (iErrs-1) Get ErrorNumber iIndex to iError Get ErrorMessage iIndex to sError Send CustomReportThisError iError sError Loop End End_Procedure