Job_ErrorHandling
Description
Section titled “Description”When Job_ErrorHandling is called the error description (sText) is placed in the top of the log. Function will return FALSE to indicate that the script has failed
The error is written as JOBERROR : <sText>. If sText is empty and iErrNumber isn’t 0, the function writes the description of the runtime error instead. Only the first error in a script is placed at the top of the log. Later errors are only written as normal log lines.
Job_ErrorHandling re-enables logging if it was disabled with Job_DisableLog.
Syntax
Section titled “Syntax”Job_ErrorHandling(sFunction, sText, iErrNumber) As Boolean
Parameters
Section titled “Parameters”sFunction (String)
Section titled “sFunction (String)”Current function
sText (String)
Section titled “sText (String)”Description of error
iErrNumber (Integer)
Section titled “iErrNumber (Integer)”Runtime error code. Use 0 if you provide sText.
Return value
Section titled “Return value”Always FALSE.
Example
Section titled “Example”Set oFsoDrv = oFso.GetDrive("A")sValue = oFsoDrv.FileSystemIf (sValue <> "") Then If bStatus Then bStatus = Job_WriteLog("Sys_GetFileSystemType", "FileSystem Type for Drive A is '" & sValue & "'", bStatus, True)Else sText = "Device not ready or unknown file system type for drive 'A'" bStatus = Job_ErrorHandling("Custom", sText, iErrNumber)End If